aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-05-31 21:49:40 +0200
committerChristian Schneppe <christian@pix-art.de>2017-05-31 21:49:40 +0200
commitc741b33bc22fc87eb75dbc448898ebeba88dbe0c (patch)
treecb7935fba0e0b7c19550e1ceb93b02ea26442f95 /src/main/java/de/pixart/messenger/ui
parent21bf06c064554c406a6b769160c36a471da45e07 (diff)
add the 4 most frequently contacted contacts as app shortcuts
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index f3cbf7be9..73400dde3 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -831,7 +831,9 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
case Intent.ACTION_VIEW:
Uri uri = intent.getData();
if (uri != null) {
- return new Invite(intent.getData(), false).invite();
+ Invite invite = new Invite(intent.getData(), false);
+ invite.account = intent.getStringExtra("account");
+ return invite.invite();
} else {
return false;
}
@@ -870,7 +872,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
finish();
return true;
}
- List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid());
+ List<Contact> contacts = xmppConnectionService.findContacts(invite.getJid(), invite.account);
if (invite.isMuc()) {
Conversation muc = xmppConnectionService.findFirstMuc(invite.getJid());
if (muc != null) {
@@ -893,6 +895,9 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
Toast.makeText(this,R.string.verified_fingerprints,Toast.LENGTH_SHORT).show();
}
}
+ if (invite.account != null) {
+ xmppConnectionService.getShortcutService().report(contact);
+ }
switchToConversation(contact, invite.getBody());
}
return true;
@@ -1182,6 +1187,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
super(uri, safeSource);
}
+ public String account;
+
boolean invite() {
if (getJid() != null) {
return handleJid(this);