Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[API] Update dbus interface
  • Loading branch information
neochapay committed Nov 23, 2018
1 parent ef6a958 commit f20b43c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 5 additions & 2 deletions src/qml/ContactCardContentWidget.qml
Expand Up @@ -86,9 +86,12 @@ Flickable {
iconSource: "image://theme/icon-m-telephony-incoming-call"; // TODO: icon-m-toolbar-make-call
text: qsTr("Call")
onClicked: {
if (contact.phoneDetails.length > 0) {
//if contact have only one phone - just call
if (contact.phoneDetails.length == 1) {
callManager.dial(callManager.defaultProviderId, contact.phoneDetails[0].number)
return
} else {
//if more - showing select dialog
}
}
}
Expand All @@ -108,7 +111,7 @@ Flickable {
text: qsTr("SMS")
onClicked: {
if (contact.phoneDetails.length > 0) {
messagesInterface.startSMS(contact.phoneDetails[0].number)
messagesInterface.startConversation(callManager.defaultProviderId, contact.phoneDetails[0].number)
return
}
}
Expand Down
13 changes: 2 additions & 11 deletions src/qml/MessagesInterface.qml
Expand Up @@ -4,20 +4,11 @@ import org.nemomobile.dbus 2.0
DBusInterface {
id: messagesInterface
service: "org.nemomobile.qmlmessages"
path: "/"
path: "/ui"
iface: "org.nemomobile.qmlmessages"

function startConversation(localUid, remoteUid) {
typedCall('startConversation', [
{ 'type':'s', 'value':localUid },
{ 'type':'s', 'value':remoteUid }
])
}

function startSMS(phoneNumber) {
typedCall('startSMS', [
{ 'type':'s', 'value':phoneNumber }
])
messagesInterface.call('startConversation', [localUid, remoteUid])
}
}

0 comments on commit f20b43c

Please sign in to comment.