[Git][gajim/gajim][master] 4 commits: Remove unused vars

Philipp Hörist gitlab at dev.gajim.org
Thu Jan 10 22:08:48 CET 2019


Philipp Hörist pushed to branch master at gajim / gajim


Commits:
247ee813 by Philipp Hörist at 2019-01-10T20:37:47Z
Remove unused vars

- - - - -
418459b6 by Philipp Hörist at 2019-01-10T20:50:49Z
DBus: Add some logging

- - - - -
5b1f8bcc by Philipp Hörist at 2019-01-10T21:07:52Z
Make sure args are always str

- - - - -
911674d5 by Philipp Hörist at 2019-01-10T21:08:11Z
Fix status tray notification

Clicking on a new message notification in the status tray didnt open the chat

- - - - -


4 changed files:

- gajim/gtk/notification.py
- gajim/gui_interface.py
- gajim/remote_control.py
- test/lib/gajim_mocks.py


Changes:

=====================================
gajim/gtk/notification.py
=====================================
@@ -89,7 +89,7 @@ class Notification:
     def _nec_notification(self, obj):
         if obj.do_popup:
             icon_name = self._get_icon_name(obj)
-            self.popup(obj.popup_event_type, obj.jid, obj.conn.name,
+            self.popup(obj.popup_event_type, str(obj.jid), obj.conn.name,
                        obj.popup_msg_type, icon_name=icon_name,
                        title=obj.popup_title, text=obj.popup_text,
                        timeout=obj.popup_timeout)
@@ -219,7 +219,7 @@ class Notification:
 
     @staticmethod
     def _make_id(*args):
-        return ','.join(args)
+        return ','.join(map(str, args))
 
 
 class PopupNotification(Gtk.Window):


=====================================
gajim/gui_interface.py
=====================================
@@ -1470,10 +1470,13 @@ class Interface:
                     app.events.change_jid(account, fjid, jid)
                     resource = None
                     fjid = jid
+
                 contact = None
                 if resource:
-                    contact = app.contacts.get_contact(account, jid, resource) or highest_contact
-                if contact is None:
+                    contact = app.contacts.get_contact(account, jid, resource)
+                if not contact:
+                    contact = highest_contact
+                if not contact:
                     # Maybe we deleted the contact from the roster
                     return
 
@@ -2507,8 +2510,6 @@ class Interface:
             app.gajim_optional_features[a] = []
             app.caps_hash[a] = ''
 
-        self.remote_ctrl = None
-
         # Handle screensaver
         if sys.platform not in ('win32', 'darwin'):
             logind.enable()


=====================================
gajim/remote_control.py
=====================================
@@ -25,6 +25,7 @@
 import os
 import base64
 import mimetypes
+import logging
 
 from gi.repository import GLib
 from gi.repository import Gio
@@ -36,6 +37,8 @@ from gajim.common import ged
 from gajim.common.connection_handlers_events import MessageOutgoingEvent
 from gajim.common.connection_handlers_events import GcMessageOutgoingEvent
 
+log = logging.getLogger('gajim.remote_control')
+
 
 def get_dbus_struct(obj):
     """
@@ -405,6 +408,7 @@ class GajimRemote(Server):
         self.raise_signal('VcardInfo', (obj.conn.name, obj.vcard_dict))
 
     def raise_signal(self, event_name, data):
+        log.info('Send event %s', event_name)
         self.con.emit_signal(None,
                              '/org/gajim/dbus/RemoteObject',
                              'org.gajim.dbus.RemoteInterface',


=====================================
test/lib/gajim_mocks.py
=====================================
@@ -102,7 +102,6 @@ class MockInterface(Mock):
         from gajim import plugins
         app.plugin_manager = plugins.PluginManager()
 
-        self.remote_ctrl = None
         self.instances = {}
         self.minimized_controls = {}
         self.status_sent_to_users = Mock()



View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/b84054b58cf940061d494c75496e45d7f0b5ec78...911674d580b83e6856b3116d7407aedae40e9baa

-- 
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/b84054b58cf940061d494c75496e45d7f0b5ec78...911674d580b83e6856b3116d7407aedae40e9baa
You're receiving this email because of your account on dev.gajim.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gajim.org/pipermail/commits/attachments/20190110/34df2e85/attachment-0001.html>


More information about the Commits mailing list