Philipp Hörist pushed to branch master at gajim / gajim
Commits:
4096ab5d by Philipp Hörist at 2018-07-31T19:20:02Z
Fix detecting oob data
- - - - -
1 changed file:
- gajim/common/modules/misc.py
Changes:
=====================================
gajim/common/modules/misc.py
=====================================
--- a/gajim/common/modules/misc.py
+++ b/gajim/common/modules/misc.py
@@ -80,7 +80,7 @@ def parse_delay(stanza, epoch=True, convert='utc'):
# XEP-0066: Out of Band Data
-def parse_oob(stanza, dict_=None, key='Gajim'):
+def parse_oob(stanza, dict_=None, key='gajim'):
oob_node = stanza.getTag('x', namespace=nbxmpp.NS_X_OOB)
if oob_node is None:
return
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4096ab5db56630b21959c3fd2821e87a9d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4096ab5db56630b21959c3fd2821e87a9d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
85bc3896 by Philipp Hörist at 2018-07-30T19:58:22Z
Handle messages without 'to' correctly
- - - - -
2 changed files:
- gajim/common/modules/carbons.py
- gajim/common/modules/message.py
Changes:
=====================================
gajim/common/modules/carbons.py
=====================================
--- a/gajim/common/modules/carbons.py
+++ b/gajim/common/modules/carbons.py
@@ -73,7 +73,7 @@ def parse_carbon(con, stanza):
type_ = carbon.getName()
to = message.getTo()
frm = message.getFrom()
- log.info('Received type: %s, from: %s, to: %s', type_, to, frm)
+ log.info('Received type: %s, from: %s', type_, frm)
if type_ == 'received':
sent = False
=====================================
gajim/common/modules/message.py
=====================================
--- a/gajim/common/modules/message.py
+++ b/gajim/common/modules/message.py
@@ -58,6 +58,23 @@ class Message:
nbxmpp.NS_IBB])
def _message_received(self, con, stanza):
+ # https://tools.ietf.org/html/rfc6120#section-8.1.1.1
+ # If the stanza does not include a 'to' address then the client MUST
+ # treat it as if the 'to' address were included with a value of the
+ # client's full JID.
+ #
+ # Implementation Note: However, if the client does
+ # check the 'to' address then it is suggested to check at most the
+ # bare JID portion (not the full JID)
+
+ own_jid = self._con.get_own_jid().getStripped()
+ to = stanza.getTo()
+ if to is None:
+ stanza.setTo(own_jid)
+ elif not to.bareMatch(own_jid):
+ log.warning('Message addressed to someone else: %s', stanza)
+ raise nbxmpp.NodeProcessed
+
# Check if a child of the message contains any
# namespaces that we handle in other modules.
# nbxmpp executes less common handlers last
@@ -118,7 +135,7 @@ class Message:
if type_ == 'groupchat':
archive_jid = stanza.getFrom().getStripped()
else:
- archive_jid = self._con.get_own_jid().getStripped()
+ archive_jid = own_jid
if app.logger.find_stanza_id(self._account,
archive_jid,
stanza_id,
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/85bc3896abcb21041bd89c7fefd96927dc…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/85bc3896abcb21041bd89c7fefd96927dc…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
23e39dc9 by Philipp Hörist at 2018-07-29T22:24:43Z
Move shortcuts dialog into gtk folder
- - - - -
3 changed files:
- gajim/app_actions.py
- + gajim/gtk/shortcuts_window.py
- − gajim/shortcuts_window.py
Changes:
=====================================
gajim/app_actions.py
=====================================
--- a/gajim/app_actions.py
+++ b/gajim/app_actions.py
@@ -21,7 +21,7 @@ from gajim.common.app import interface
from gajim.common.exceptions import GajimGeneralException
from gajim import config
from gajim import dialogs
-from gajim import shortcuts_window
+from gajim.gtk import shortcuts_window
from gajim import accounts_window
import gajim.plugins.gui
from gajim import history_window
=====================================
gajim/gtk/shortcuts_window.py
=====================================
--- /dev/null
+++ b/gajim/gtk/shortcuts_window.py
@@ -0,0 +1,43 @@
+# This file is part of Gajim.
+#
+# Gajim is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published
+# by the Free Software Foundation; version 3 only.
+#
+# Gajim is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
+
+from gajim.gtk.util import get_builder
+from gajim.common import helpers
+
+__all__ = ['show']
+
+
+class ShortcutsWindow:
+ def __init__(self):
+ self.window = None
+
+ def show(self, parent=None):
+ if self.window is None:
+ builder = get_builder('shortcuts_window.ui')
+ self.window = builder.get_object('shortcuts_window')
+ self.window.connect('destroy', self._on_window_destroy)
+ self.window.set_transient_for(parent)
+ self.window.show_all()
+ self.window.present()
+
+ def _on_window_destroy(self, widget):
+ self.window = None
+
+
+def show_shortcuts_webpage(self, parent=None):
+ helpers.launch_browser_mailer(
+ 'url',
+ 'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts')
+
+show = ShortcutsWindow().show
=====================================
gajim/shortcuts_window.py deleted
=====================================
--- a/gajim/shortcuts_window.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding:utf-8 -*-
-## src/shortcuts_window.py
-##
-## This file is part of Gajim.
-##
-## Gajim is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published
-## by the Free Software Foundation; version 3 only.
-##
-## Gajim is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
-##
-
-from gi.repository import Gtk
-
-from gajim import gtkgui_helpers
-
-from gajim.common import helpers
-
-__all__ = ['show']
-
-class ShortcutsWindow:
- def __init__(self):
- self.window = None
-
- def show(self, parent=None):
- if self.window is None:
- builder = gtkgui_helpers.get_gtk_builder('shortcuts_window.ui')
- self.window = builder.get_object('shortcuts_window')
- self.window.connect('destroy', self._on_window_destroy)
- self.window.set_transient_for(parent)
- self.window.show_all()
- self.window.present()
-
- def _on_window_destroy(self, widget):
- self.window = None
-
-def show_shortcuts_webpage(self, parent=None):
- helpers.launch_browser_mailer('url',
- 'https://dev.gajim.org/gajim/gajim/wikis/help/keyboardshortcuts')
-
-if (3, 19) <= (Gtk.get_major_version(), Gtk.get_minor_version()):
- show = ShortcutsWindow().show
-else:
- show = show_shortcuts_webpage
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/23e39dc9e69138294880126b80a9ebacbc…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/23e39dc9e69138294880126b80a9ebacbc…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
394d38e6 by Philipp Hörist at 2018-07-29T20:16:06Z
Add lost server discovery query
- - - - -
1 changed file:
- gajim/common/connection.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1456,6 +1456,7 @@ class Connection(CommonConnection, ConnectionHandlers):
# This starts the connect_machine
self.get_module('Discovery').discover_server_info()
self.get_module('Discovery').discover_account_info()
+ self.get_module('Discovery').discover_server_items()
self.sm.resuming = False # back to previous state
# Discover Stun server(s)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/394d38e663098199bcef6f9340337df3ab…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/394d38e663098199bcef6f9340337df3ab…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
80aee95f by Philipp Hörist at 2018-07-29T17:35:45Z
Reset connect_maschine after disconnect on purpose
- - - - -
1 changed file:
- gajim/common/modules/discovery.py
Changes:
=====================================
gajim/common/modules/discovery.py
=====================================
--- a/gajim/common/modules/discovery.py
+++ b/gajim/common/modules/discovery.py
@@ -179,6 +179,7 @@ class Discovery:
self._con.get_module('PubSub').pass_disco(from_, *args)
def discover_server_info(self):
+ # Calling this method starts the connect_maschine()
server = self._con.get_own_jid().getDomain()
self.disco_info(server, success_cb=self._server_info_received)
@@ -199,7 +200,7 @@ class Discovery:
if nbxmpp.NS_ADDRESS in features:
self._con.addressing_supported = True
- self._con.connect_machine()
+ self._con.connect_machine(restart=True)
def _parse_transports(self, from_, identities, features, data, node):
for identity in identities:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/80aee95f2ec38dfea321adbfc8c0161f49…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/80aee95f2ec38dfea321adbfc8c0161f49…
You're receiving this email because of your account on dev.gajim.org.