Philipp Hörist pushed to branch master at gajim / gajim
Commits:
633795b7 by Philipp Hörist at 2019-01-05T18:17:34Z
Dont fail on users leaving a group chat
Fixes #9527
- - - - -
19c45510 by Philipp Hörist at 2019-01-05T18:17:34Z
MUC: Fix printing status/show
- rename config values to something more appropriate
- - - - -
4 changed files:
- gajim/common/config.py
- gajim/common/modules/muc.py
- gajim/groupchat_control.py
- gajim/gtk/preferences.py
Changes:
=====================================
gajim/common/config.py
=====================================
@@ -235,8 +235,8 @@ class Config:
'show_location_in_roster': [opt_bool, True, '', True],
'avatar_position_in_roster': [opt_str, 'right', _('Define the position of the avatar in roster. Can be left or right'), True],
'print_status_in_chats': [opt_bool, False, _('If False, Gajim will no longer print status line in chats when a contact changes their status and/or their status message.')],
- 'print_join_leave_in_mucs': [opt_bool, False, _('Default Setting: Show a status message for every join or leave in a group chat')],
- 'print_status_in_mucs': [opt_bool, False, _('Default Setting: Show a status message for all status (away, dnd, etc.) changes of users in a group chat')],
+ 'print_join_left_default': [opt_bool, False, _('Default Setting: Show a status message for every join or leave in a group chat')],
+ 'print_status_muc_default': [opt_bool, False, _('Default Setting: Show a status message for all status (away, dnd, etc.) changes of users in a group chat')],
'log_contact_status_changes': [opt_bool, False],
'log_xhtml_messages': [opt_bool, False, _('Log XHTML messages instead of plain text messages.')],
'restored_messages_small': [opt_bool, True, _('If true, restored messages will use a smaller font than the default one.')],
=====================================
gajim/common/modules/muc.py
=====================================
@@ -226,10 +226,16 @@ class MUC:
# handled by the opened ChatControl
break
- # We remove the contact from the MUC, but there could be
- # a PrivateChatControl open, so we update the contacts presence
- contact.presence = properties.type
- app.contacts.remove_gc_contact(self._account, contact)
+ if contact is None:
+ # If contact is None, its probably that a user left from a not
+ # insync MUC, can happen on older servers
+ log.warning('Unknown contact left groupchat: %s',
+ properties.jid)
+ else:
+ # We remove the contact from the MUC, but there could be
+ # a PrivateChatControl open, so we update the contacts presence
+ contact.presence = properties.type
+ app.contacts.remove_gc_contact(self._account, contact)
log.info('User %s left', properties.jid)
self._raise_muc_event('muc-user-left', properties)
raise nbxmpp.NodeProcessed
=====================================
gajim/groupchat_control.py
=====================================
@@ -397,7 +397,7 @@ class GroupchatControl(ChatControlBase):
act.connect('change-state', self._on_notify_on_all_messages)
self.parent_win.window.add_action(act)
- status_default = app.config.get('print_status_in_mucs')
+ status_default = app.config.get('print_status_muc_default')
value = app.config.get_per('rooms', self.contact.jid,
'print_status', status_default)
@@ -407,7 +407,7 @@ class GroupchatControl(ChatControlBase):
act.connect('change-state', self._on_print_status)
self.parent_win.window.add_action(act)
- join_default = app.config.get('print_join_leave_in_mucs')
+ join_default = app.config.get('print_join_left_default')
value = app.config.get_per('rooms', self.contact.jid,
'print_join_left', join_default)
@@ -2008,8 +2008,9 @@ class GroupchatControl(ChatControlBase):
#Group Chat: We have been removed from the room
message = _('{nick} has been removed from the room{by}{reason}')
+ join_default = app.config.get('print_join_left_default')
print_join_left = app.config.get_per(
- 'rooms', self.room_jid, 'print_join_left')
+ 'rooms', self.room_jid, 'print_join_left', join_default)
if StatusCode.REMOVED_ERROR in status_codes:
# Handle 333 before 307, some MUCs add both
@@ -2060,8 +2061,9 @@ class GroupchatControl(ChatControlBase):
return
nick = event.properties.muc_nickname
+ join_default = app.config.get('print_join_left_default')
print_join_left = app.config.get_per(
- 'rooms', self.room_jid, 'print_join_left')
+ 'rooms', self.room_jid, 'print_join_left', join_default)
self.add_contact_to_roster(nick)
=====================================
gajim/gtk/preferences.py
=====================================
@@ -161,10 +161,10 @@ class Preferences(Gtk.ApplicationWindow):
self._ui.sync_threshold_combobox.set_id_column(0)
self._ui.sync_threshold_combobox.set_active_id(str(public_threshold))
- st = app.config.get('print_join_leave_in_mucs')
+ st = app.config.get('print_join_left_default')
self._ui.join_leave_checkbutton.set_active(st)
- st = app.config.get('print_status_in_mucs')
+ st = app.config.get('print_status_muc_default')
self._ui.status_change_checkbutton.set_active(st)
# Displayed chat state notifications
@@ -620,10 +620,10 @@ class Preferences(Gtk.ApplicationWindow):
app.config.set('public_room_sync_threshold', int(active))
def _on_join_leave_toggled(self, widget):
- self.on_checkbutton_toggled(widget, 'print_join_leave_in_mucs')
+ self.on_checkbutton_toggled(widget, 'print_join_left_default')
def _on_status_change_toggled(self, widget):
- self.on_checkbutton_toggled(widget, 'print_status_in_mucs')
+ self.on_checkbutton_toggled(widget, 'print_status_muc_default')
def on_show_chatstate_in_tabs_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'show_chatstate_in_tabs')
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/a91f5f2c4914b597c9833894c8a31c6ba…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/a91f5f2c4914b597c9833894c8a31c6ba…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a91f5f2c by Sebastiaan Lokhorst at 2019-01-05T17:37:09Z
Fix Bonjour (pybonjour) on macOS
- - - - -
2 changed files:
- README.md
- gajim/common/app.py
Changes:
=====================================
README.md
=====================================
@@ -17,7 +17,7 @@
- python3-pil (pillow) for support of webp avatars
- python3-gnupg to enable GPG encryption
-- For zeroconf (bonjour) you need python3-dbus
+- For zeroconf you need python3-dbus on Linux or [pybonjour](https://dev.gajim.org/lovetox/pybonjour-python3) on Windows/macOS
- gir1.2-gspell-1 and hunspell-LANG where lang is your locale eg. en, fr etc
- gir1.2-secret-1 for GNOME Keyring or KDE support as password storage
- D-Bus running to have gajim-remote working
=====================================
gajim/common/app.py
=====================================
@@ -220,12 +220,14 @@ def detect_dependencies():
# ZEROCONF
try:
- if os.name == 'nt':
- import pybonjour # pylint: disable=unused-variable
- _dependencies['PYBONJOUR'] = True
- else:
- import dbus # pylint: disable=unused-variable
- _dependencies['PYTHON-DBUS'] = True
+ import pybonjour # pylint: disable=unused-variable
+ _dependencies['PYBONJOUR'] = True
+ except Exception:
+ pass
+
+ try:
+ import dbus # pylint: disable=unused-variable
+ _dependencies['PYTHON-DBUS'] = True
except Exception:
pass
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a91f5f2c4914b597c9833894c8a31c6ba0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a91f5f2c4914b597c9833894c8a31c6ba0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
4bd14bc5 by Philipp Hörist at 2019-01-04T10:56:23Z
Use custom link handler in AboutDialog
Fixes #9525
- - - - -
1 changed file:
- gajim/gtk/about.py
Changes:
=====================================
gajim/gtk/about.py
=====================================
@@ -14,10 +14,12 @@
import nbxmpp
+from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GObject
from gajim.common import app
+from gajim.common.helpers import launch_browser_mailer
from gajim.common.i18n import _
from gajim.common.const import DEVS_CURRENT
from gajim.common.const import DEVS_PAST
@@ -65,3 +67,25 @@ class AboutDialog(Gtk.AboutDialog):
'response', lambda dialog, *args: Gtk.AboutDialog.do_close(dialog))
self.show()
+ self.connect('activate-link', self._on_activate_link)
+ # See https://gitlab.gnome.org/GNOME/gtk/issues/1561
+ self._connect_link_handler(self)
+
+ @staticmethod
+ def _on_activate_link(_label, uri):
+ # We have to use this, because the default GTK handler
+ # is not cross-platform compatible
+ launch_browser_mailer(None, uri)
+ return Gdk.EVENT_STOP
+
+ def _connect_link_handler(self, parent):
+ def _find_child(parent_):
+ if not hasattr(parent_, 'get_children'):
+ return
+
+ for child in parent_.get_children():
+ if isinstance(child, Gtk.Label):
+ if 'href' in child.get_label():
+ child.connect('activate-link', self._on_activate_link)
+ _find_child(child)
+ _find_child(parent)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4bd14bc51d0647a48c3d495bbbe7f0ab5f…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4bd14bc51d0647a48c3d495bbbe7f0ab5f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
02eaaa7d by Philipp Hörist at 2019-01-04T06:31:52Z
Set from to own jid if attr is not present
- - - - -
1 changed file:
- nbxmpp/dispatcher_nb.py
Changes:
=====================================
nbxmpp/dispatcher_nb.py
=====================================
@@ -519,6 +519,9 @@ class XMPPDispatcher(PlugIn):
log.warning('Message addressed to someone else: %s', stanza)
return
+ if stanza.getFrom() is None:
+ stanza.setFrom(own_jid.getBare())
+
# Unwrap carbon
try:
stanza, properties.carbon_type = unwrap_carbon(stanza, own_jid)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/02eaaa7da60f13e7949ee22e20…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/02eaaa7da60f13e7949ee22e20…
You're receiving this email because of your account on dev.gajim.org.