quietly ignore mediated invites from blocked contacts
This commit is contained in:
parent
894ff1918c
commit
9a922ffe5d
|
@ -1097,22 +1097,26 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
||||||
this.inviter = inviter;
|
this.inviter = inviter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean execute(Account account) {
|
public boolean execute(final Account account) {
|
||||||
if (jid != null) {
|
if (this.jid == null) {
|
||||||
Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, jid, true, false);
|
return false;
|
||||||
if (conversation.getMucOptions().online()) {
|
|
||||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received invite to " + jid + " but muc is considered to be online");
|
|
||||||
mXmppConnectionService.mucSelfPingAndRejoin(conversation);
|
|
||||||
} else {
|
|
||||||
conversation.getMucOptions().setPassword(password);
|
|
||||||
mXmppConnectionService.databaseBackend.updateConversation(conversation);
|
|
||||||
final Contact contact = inviter != null ? account.getRoster().getContactFromContactList(inviter) : null;
|
|
||||||
mXmppConnectionService.joinMuc(conversation, contact != null && contact.mutualPresenceSubscription());
|
|
||||||
mXmppConnectionService.updateConversationUi();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
final Contact contact = this.inviter != null ? account.getRoster().getContact(this.inviter) : null;
|
||||||
|
if (contact != null && contact.isBlocked()) {
|
||||||
|
Log.d(Config.LOGTAG,account.getJid().asBareJid()+": ignore invite from "+contact.getJid()+" because contact is blocked");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final Conversation conversation = mXmppConnectionService.findOrCreateConversation(account, jid, true, false);
|
||||||
|
if (conversation.getMucOptions().online()) {
|
||||||
|
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received invite to " + jid + " but muc is considered to be online");
|
||||||
|
mXmppConnectionService.mucSelfPingAndRejoin(conversation);
|
||||||
|
} else {
|
||||||
|
conversation.getMucOptions().setPassword(password);
|
||||||
|
mXmppConnectionService.databaseBackend.updateConversation(conversation);
|
||||||
|
mXmppConnectionService.joinMuc(conversation, contact != null && contact.showInContactList());
|
||||||
|
mXmppConnectionService.updateConversationUi();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue