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(); final Conversation conversation = (Conversation) message.getConversation();
account.deactivateGracePeriod(); 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; MessagePacket packet = null;
final boolean addToConversation = (conversation.getMode() != Conversation.MODE_MULTI final boolean addToConversation = (conversation.getMode() != Conversation.MODE_MULTI
|| !Patches.BAD_MUC_REFLECTION.contains(account.getServerIdentity())) || !Patches.BAD_MUC_REFLECTION.contains(account.getServerIdentity()))

View File

@ -1068,7 +1068,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
if (contact.isSelf()) { if (contact.isSelf()) {
showContactDetailsItem.setVisible(false); showContactDetailsItem.setVisible(false);
} }
deleteContactMenuItem.setVisible(contact.showInRoster()); deleteContactMenuItem.setVisible(contact.showInRoster() && !contact.getOption(Contact.Options.SYNCED_VIA_OTHER));
XmppConnection xmpp = contact.getAccount().getXmppConnection(); XmppConnection xmpp = contact.getAccount().getXmppConnection();
if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) {
if (contact.isBlocked()) { if (contact.isBlocked()) {
@ -1115,8 +1115,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
} }
public class ListPagerAdapter extends PagerAdapter { public class ListPagerAdapter extends PagerAdapter {
FragmentManager fragmentManager; private final FragmentManager fragmentManager;
MyListFragment[] fragments; private final MyListFragment[] fragments;
ListPagerAdapter(FragmentManager fm) { ListPagerAdapter(FragmentManager fm) {
fragmentManager = fm; fragmentManager = fm;