changeset af78b7c06890 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=af78b7c06890 description: Ignore roster pushes that are not from our JID or our server. Ignore badly farmated roster pushes.
diffstat:
src/common/connection_handlers_events.py | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
diffs (26 lines):
diff -r fc540d01a959 -r af78b7c06890 src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Sat Dec 19 11:15:40 2015 +0100 +++ b/src/common/connection_handlers_events.py Sun Dec 20 20:42:38 2015 +0100 @@ -407,6 +407,10 @@ base_network_events = []
def generate(self): + frm = helpers.get_jid_from_iq(self.stanza) + our_jid = gajim.get_jid_from_account(self.conn.name) + if frm and frm != our_jid and frm != gajim.get_server_from_jid(our_jid): + return self.version = self.stanza.getTagAttr('query', 'ver') self.items = {} for item in self.stanza.getTag('query').getChildren(): @@ -423,6 +427,11 @@ groups.append(group.getData()) self.items[jid] = {'name': name, 'sub': sub, 'ask': ask, 'groups': groups} + if len(self.items) > 1: + reply = nbxmpp.Iq(typ='error', attrs={'id': self.stanza.getID()}, + to=self.stanza.getFrom(), frm=self.stanza.getTo(), xmlns=None) + self.conn.connection.send(reply) + return if self.conn.connection and self.conn.connected > 1: reply = nbxmpp.Iq(typ='result', attrs={'id': self.stanza.getID()}, to=self.stanza.getFrom(), frm=self.stanza.getTo(), xmlns=None)