325
325
multiRecipient.forceActiveFocus()
328
function sendMessage(text, participantIds, attachments) {
328
function sendMessage(text, participantIds, attachments, properties) {
329
if (typeof(properties) === 'undefined') {
329
333
// check if at least one account is selected
330
334
if (!messages.account) {
331
335
Qt.inputMethod.hide()
428
432
eventModel.writeEvents([event]);
430
var isMMS = attachments.length > 0
431
var isMmsGroupChat = participantIds.length > 1 && telepathyHelper.mmsGroupChat
434
var isMmsGroupChat = participants.length > 1 && telepathyHelper.mmsGroupChat && messages.account.type == AccountEntry.PhoneAccount
432
435
// mms group chat only works if we know our own phone number
433
436
var isSelfContactKnown = account.selfContactId != ""
434
// FIXME: maybe move this to telepathy-ofono itself and treat as just sendMessage on the app?
435
if (isMMS || (isMmsGroupChat && isSelfContactKnown)) {
436
chatManager.sendMMS(participantIds, text, attachments, messages.account.accountId)
438
chatManager.sendMessage(participantIds, text, messages.account.accountId)
437
if (isMmsGroupChat && !isSelfContactKnown) {
438
// TODO: inform the user to enter the phone number of the selected sim card manually
439
// and use it in the telepathy-ofono account as selfContactId.
442
chatManager.sendMessage(messages.account.accountId, participantIds, text, attachments, properties)
442
445
// FIXME: soon it won't be just about SIM cards, so the dialogs need updating
443
if (multiplePhoneAccounts && !telepathyHelper.defaultMessagingAccount && !settings.messagesDontAsk) {
446
if (multiplePhoneAccounts && !telepathyHelper.defaultMessagingAccount && !settings.messagesDontAsk && account.type == AccountEntry.PhoneAccount) {
444
447
Qt.inputMethod.hide()
445
448
PopupUtils.open(Qt.createComponent("Dialogs/SetDefaultSIMCardDialog.qml").createObject(messages))