diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-11-23 13:24:52 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-11-23 13:24:52 +0100 |
commit | b89c63d48eace345b3f980d962ca967d12eb95e3 (patch) | |
tree | fe1bcb1e2217605367a19994229f9622d4a4ac1e /src/main/java/de/pixart | |
parent | 9d72ef6f32da0a1938735fef89d547a3750d4cdb (diff) |
add suggested contacts to roster on first message
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 7 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartConversationActivity.java | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index a86fc22e1..d889cdee8 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1357,6 +1357,13 @@ public class XmppConnectionService extends Service { } final Conversation conversation = (Conversation) message.getConversation(); account.deactivateGracePeriod(); + if (QuickConversationsService.isQuicksy() && conversation.getMode() == Conversation.MODE_SINGLE) { + final Contact contact = conversation.getContact(); + if (!contact.showInRoster() && contact.getOption(Contact.Options.SYNCED_VIA_OTHER)) { + Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": adding " + contact.getJid() + " on sending message"); + createContact(contact, true); + } + } MessagePacket packet = null; final boolean addToConversation = (conversation.getMode() != Conversation.MODE_MULTI || !Patches.BAD_MUC_REFLECTION.contains(account.getServerIdentity())) diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index b1c3b6733..e4812528d 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -1058,7 +1058,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne if (contact.isSelf()) { showContactDetailsItem.setVisible(false); } - deleteContactMenuItem.setVisible(contact.showInRoster()); + deleteContactMenuItem.setVisible(contact.showInRoster() && !contact.getOption(Contact.Options.SYNCED_VIA_OTHER)); XmppConnection xmpp = contact.getAccount().getXmppConnection(); if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (contact.isBlocked()) { @@ -1105,10 +1105,10 @@ public class StartConversationActivity extends XmppActivity implements XmppConne } public class ListPagerAdapter extends PagerAdapter { - FragmentManager fragmentManager; - MyListFragment[] fragments; + private final FragmentManager fragmentManager; + private final MyListFragment[] fragments; - public ListPagerAdapter(FragmentManager fm) { + ListPagerAdapter(FragmentManager fm) { fragmentManager = fm; fragments = new MyListFragment[2]; } |