[Git][gajim/gajim][master] Fix typo

2018-07-05 Thread Philipp Hörist
Philipp Hörist pushed to branch master at gajim / gajim


Commits:
1712743f by Philipp Hörist at 2018-07-05T18:14:36+02:00
Fix typo

- - - - -


1 changed file:

- gajim/common/modules/user_tune.py


Changes:

=
gajim/common/modules/user_tune.py
=
--- a/gajim/common/modules/user_tune.py
+++ b/gajim/common/modules/user_tune.py
@@ -69,7 +69,7 @@ class UserTune(AbstractPEPModule):
 tune_dict = {}
 tune_tag = item.getTag('tune', namespace=self.namespace)
 if tune_tag is None:
-raise StanzaMalformed('No activity node')
+raise StanzaMalformed('No tune node')
 
 for child in tune_tag.getChildren():
 name = child.getName().strip()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1712743fd5372b18c011163d0b8fa76688cd10f3

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/1712743fd5372b18c011163d0b8fa76688cd10f3
You're receiving this email because of your account on dev.gajim.org.
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][master] Fix regression from 2ca0ca38

2018-07-05 Thread Philipp Hörist
Philipp Hörist pushed to branch master at gajim / gajim


Commits:
3b7055ca by Philipp Hörist at 2018-07-05T18:06:48+02:00
Fix regression from 2ca0ca38

Fixes #9230

- - - - -


1 changed file:

- gajim/groupchat_control.py


Changes:

=
gajim/groupchat_control.py
=
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -1975,13 +1975,11 @@ class GroupchatControl(ChatControlBase):
 and (not obj.status_code or '303' not in obj.status_code) and not \
 right_changed:
 st = ''
-print_status = None
-for bookmark in app.connections[self.account].bookmarks:
-if bookmark['jid'] == self.room_jid:
-print_status = bookmark.get('print_status', None)
-break
-if not print_status:
-print_status = app.config.get('print_status_in_muc')
+con = app.connections[self.account]
+bookmarks = con.get_module('Bookmarks').bookmarks
+bookmark = bookmarks.get(self.room_jid, None)
+print_status = bookmark.get(
+'print_status', app.config.get('print_status_in_muc'))
 if obj.show == 'offline':
 if obj.nick in self.attention_list:
 self.attention_list.remove(obj.nick)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/3b7055ca743a6e93f2c412ac43ebd59411f05d2f

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/3b7055ca743a6e93f2c412ac43ebd59411f05d2f
You're receiving this email because of your account on dev.gajim.org.
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][master] 3 commits: Add message handlers for AUTH and ROSTERX

2018-07-05 Thread Philipp Hörist
Philipp Hörist pushed to branch master at gajim / gajim


Commits:
503ee35b by Philipp Hörist at 2018-07-05T21:09:55+02:00
Add message handlers for AUTH and ROSTERX

- - - - -
51e85f14 by Philipp Hörist at 2018-07-05T21:41:28+02:00
Remove unused code

- - - - -
a1e1e56d by Philipp Hörist at 2018-07-05T22:03:06+02:00
Fix logic error when printing status

- - - - -


6 changed files:

- gajim/common/connection.py
- gajim/common/connection_handlers.py
- gajim/common/connection_handlers_events.py
- gajim/common/modules/http_auth.py
- gajim/common/modules/roster_item_exchange.py
- gajim/groupchat_control.py


Changes:

=
gajim/common/connection.py
=
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -630,7 +630,6 @@ class Connection(CommonConnection, ConnectionHandlers):
 self.last_time_to_reconnect = None
 self.new_account_info = None
 self.new_account_form = None
-self.last_io = app.idlequeue.current_time()
 self.last_sent = []
 self.password = passwords.get_password(name)
 
@@ -1512,7 +1511,6 @@ class Connection(CommonConnection, ConnectionHandlers):
 app.nec.push_incoming_event(AnonymousAuthEvent(None,
 conn=self, old_jid=old_jid, new_jid=new_jid))
 if auth:
-self.last_io = app.idlequeue.current_time()
 self.connected = 2
 self.retrycount = 0
 if self.on_connect_auth:


=
gajim/common/connection_handlers.py
=
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -302,6 +302,11 @@ class ConnectionHandlersBase:
 # We decrypt GPG messages one after the other. Keep queue in mem
 self.gpg_messages_to_decrypt = []
 
+# XEPs that are based on Message
+self._message_namespaces = set([nbxmpp.NS_HTTP_AUTH,
+nbxmpp.NS_PUBSUB_EVENT,
+nbxmpp.NS_ROSTERX])
+
 app.ged.register_event_handler('iq-error-received', ged.CORE,
 self._nec_iq_error_received)
 app.ged.register_event_handler('presence-received', ged.CORE,
@@ -1023,7 +1028,13 @@ ConnectionHTTPUpload):
 """
 Called when we receive a message
 """
-if nbxmpp.NS_PUBSUB_EVENT in stanza.getProperties():
+
+# Check if a child of the message contains any
+# of these namespaces, so we dont execute the
+# message handler for them.
+# They have defined their own message handlers
+# but nbxmpp executes less common handlers last
+if self._message_namespaces & set(stanza.getProperties()):
 return
 log.debug('MessageCB')
 
@@ -1192,9 +1203,6 @@ ConnectionHTTPUpload):
 # This way we'll really remove it
 app.to_be_removed[self.name].remove(jid)
 
-def _StanzaArrivedCB(self, con, obj):
-self.last_io = app.idlequeue.current_time()
-
 def _MucOwnerCB(self, con, iq_obj):
 log.debug('MucOwnerCB')
 app.nec.push_incoming_event(MucOwnerReceivedEvent(None, conn=self,
@@ -1459,10 +1467,7 @@ ConnectionHTTPUpload):
 con.RegisterHandler('iq', self._JingleCB, 'set', nbxmpp.NS_JINGLE)
 con.RegisterHandler('iq', self._ErrorCB, 'error')
 con.RegisterHandler('iq', self._IqCB)
-con.RegisterHandler('iq', self._StanzaArrivedCB)
 con.RegisterHandler('iq', self._ResultCB, 'result')
-con.RegisterHandler('presence', self._StanzaArrivedCB)
-con.RegisterHandler('message', self._StanzaArrivedCB)
 con.RegisterHandler('unknown', self._StreamCB,
 nbxmpp.NS_XMPP_STREAMS, xmlns=nbxmpp.NS_STREAMS)
 con.RegisterHandler('iq', self._PubkeyGetCB, 'get',


=
gajim/common/connection_handlers_events.py
=
--- a/gajim/common/connection_handlers_events.py
+++ b/gajim/common/connection_handlers_events.py
@@ -914,18 +914,6 @@ class MessageReceivedEvent(nec.NetworkIncomingEvent, 
HelperEvent):
  self.stanza.getFrom())
 return
 
-# check if the message is a roster item exchange (XEP-0144)
-if self.stanza.getTag('x', namespace=nbxmpp.NS_ROSTERX):
-self.conn.get_module('RosterItemExchange').received_item(
-self.conn, self.stanza)
-return
-
-# check if the message is a XEP-0070 confirmation request
-if self.stanza.getTag('confirm', namespace=nbxmpp.NS_HTTP_AUTH):
-self.conn.get_module('HTTPAuth').answer_request(
-self.conn, self.stanza)
-return
-
 try:
 self.get_jid_resource()
 except helpers.InvalidFormat:


=
gajim/common/modules/http_auth.py

[Git][gajim/gajim][master] Raise NodeProcessed after processing ROSTERX

2018-07-05 Thread Philipp Hörist
Philipp Hörist pushed to branch master at gajim / gajim


Commits:
0a6b2126 by Philipp Hörist at 2018-07-05T23:55:09+02:00
Raise NodeProcessed after processing ROSTERX

- - - - -


1 changed file:

- gajim/common/modules/roster_item_exchange.py


Changes:

=
gajim/common/modules/roster_item_exchange.py
=
--- a/gajim/common/modules/roster_item_exchange.py
+++ b/gajim/common/modules/roster_item_exchange.py
@@ -44,7 +44,8 @@ class RosterItemExchange:
 items_list = stanza.getTag(
 'x', namespace=nbxmpp.NS_ROSTERX).getChildren()
 if items_list is None:
-return
+raise nbxmpp.NodeProcessed
+
 action = items_list[0].getAttr('action')
 if not action:
 action = 'add'
@@ -77,7 +78,7 @@ class RosterItemExchange:
 exchange_items_list[jid] = [name, groups]
 
 if not exchange_items_list:
-return
+raise nbxmpp.NodeProcessed
 
 log.info('Items: %s', exchange_items_list)
 
@@ -87,8 +88,7 @@ class RosterItemExchange:
 exchange_items_list=exchange_items_list,
 action=action))
 
-if stanza.name == 'iq':
-raise nbxmpp.NodeProcessed
+raise nbxmpp.NodeProcessed
 
 def send_contacts(self, contacts, fjid, type_='message'):
 if not app.account_is_connected(self._account):



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/0a6b2126b34dd9d627e203a630c185f2dfc34e1d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/0a6b2126b34dd9d627e203a630c185f2dfc34e1d
You're receiving this email because of your account on dev.gajim.org.
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits