add suggested contacts to roster on first message

This commit is contained in:
Daniel Gultsch 2018-11-08 12:20:46 +01:00
parent ffc509ae26
commit e450626d5c
2 changed files with 13 additions and 3 deletions

View file

@ -1205,6 +1205,16 @@ 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()))

View file

@ -1068,7 +1068,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()) {
@ -1115,8 +1115,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
}
public class ListPagerAdapter extends PagerAdapter {
FragmentManager fragmentManager;
MyListFragment[] fragments;
private final FragmentManager fragmentManager;
private final MyListFragment[] fragments;
ListPagerAdapter(FragmentManager fm) {
fragmentManager = fm;