Philipp Hörist pushed to branch master at gajim / gajim
Commits:
be96422a by Philipp Hörist at 2018-08-31T22:03:24Z
Disco the room after it has been created
- - - - -
1 changed file:
- gajim/groupchat_control.py
Changes:
=====================================
gajim/groupchat_control.py
=====================================
--- a/gajim/groupchat_control.py
+++ b/gajim/groupchat_control.py
@@ -1818,6 +1818,8 @@ class GroupchatControl(ChatControlBase):
# app.py)
self.print_conversation(_('Room logging is enabled'))
if '201' in obj.status_code:
+ app.connections[self.account].get_module('Discovery').disco_muc(
+ self.room_jid, self.update_actions, update=True)
self.print_conversation(_('A new room has been created'))
if '210' in obj.status_code:
self.print_conversation(\
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/be96422a1498cca384d4ba41e919908549…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/be96422a1498cca384d4ba41e919908549…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
527762f7 by Philipp Hörist at 2018-08-31T04:37:53Z
Fix missing attribute
- - - - -
1 changed file:
- gajim/common/connection_handlers_events.py
Changes:
=====================================
gajim/common/connection_handlers_events.py
=====================================
--- a/gajim/common/connection_handlers_events.py
+++ b/gajim/common/connection_handlers_events.py
@@ -487,6 +487,7 @@ class GcMessageReceivedEvent(nec.NetworkIncomingEvent):
self.xhtml_msgtxt = self.stanza.getXHTML()
self.encrypted = self.msg_obj.encrypted
self.correct_id = None # XEP-0308
+ self.delayed = self.msg_obj.delayed
if app.config.get('ignore_incoming_xhtml'):
self.xhtml_msgtxt = None
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/527762f726577e451421a2c11228e8f2a6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/527762f726577e451421a2c11228e8f2a6…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
7d4a9b91 by Yann Leboulanger at 2018-08-30T10:21:43Z
better fix for joining groupchats with uppercase letters. Fixes #9198
- - - - -
1 changed file:
- gajim/gtk/join_groupchat.py
Changes:
=====================================
gajim/gtk/join_groupchat.py
=====================================
--- a/gajim/gtk/join_groupchat.py
+++ b/gajim/gtk/join_groupchat.py
@@ -203,7 +203,12 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow):
return
self.room_jid = '%s@%s' % (room, server)
- self.room_jid = self.room_jid.lower()
+
+ try:
+ self.room_jid = helpers.parse_jid(self.room_jid)
+ except helpers.InvalidFormat as error:
+ ErrorDialog(_('Invalid JID'), str(error), transient_for=self)
+ return
if app.in_groupchat(account, self.room_jid):
# If we already in the groupchat, join_gc_room will bring
@@ -223,12 +228,6 @@ class JoinGroupchatWindow(Gtk.ApplicationWindow):
ErrorDialog(_('Invalid Nickname'), str(error), transient_for=self)
return
- try:
- helpers.parse_jid(self.room_jid)
- except helpers.InvalidFormat as error:
- ErrorDialog(_('Invalid JID'), str(error), transient_for=self)
- return
-
if not app.account_is_connected(account):
ErrorDialog(
_('You are not connected to the server'),
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7d4a9b91c8787ee2bd4821bba6a4aef93d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/7d4a9b91c8787ee2bd4821bba6a4aef93d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
931e3f60 by Philipp Hörist at 2018-08-28T21:03:00Z
Register modules defined by plugins
- - - - -
5 changed files:
- gajim/accounts_window.py
- gajim/common/connection_handlers.py
- gajim/common/modules/__init__.py
- gajim/gtk/account_wizard.py
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/accounts_window.py
=====================================
--- a/gajim/accounts_window.py
+++ b/gajim/accounts_window.py
@@ -236,6 +236,9 @@ class AccountsWindow(Gtk.ApplicationWindow):
else:
app.connections[account] = Connection(account)
+ app.plugin_manager.register_modules_for_account(
+ app.connections[account])
+
# update variables
app.interface.instances[account] = {
'infos': {}, 'disco': {}, 'gc_config': {}, 'search': {},
=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -408,6 +408,9 @@ class ConnectionHandlers(ConnectionSocks5Bytestream,
self.continue_connect_info = None
+ # If handlers have been registered
+ self.handlers_registered = False
+
app.nec.register_incoming_event(StreamConflictReceivedEvent)
app.nec.register_incoming_event(NotificationEvent)
@@ -655,9 +658,11 @@ class ConnectionHandlers(ConnectionSocks5Bytestream,
for handler in modules.get_handlers(self):
con.RegisterHandler(*handler)
+ self.handlers_registered = True
def _unregister_handlers(self):
if not self.connection:
return
for handler in modules.get_handlers(self):
self.connection.UnregisterHandler(*handler)
+ self.handlers_registered = False
=====================================
gajim/common/modules/__init__.py
=====================================
--- a/gajim/common/modules/__init__.py
+++ b/gajim/common/modules/__init__.py
@@ -80,10 +80,27 @@ def register(con, *args, **kwargs):
_modules[con.name][name] = instance
+def register_single(con, instance, name):
+ if con.name not in _modules:
+ raise ValueError('Unknown account name: %s' % con.name)
+ _modules[con.name][name] = instance
+
+
def unregister(con):
+ for instance in _modules[con.name].values():
+ if hasattr(instance, 'cleanup'):
+ instance.cleanup()
del _modules[con.name]
+def unregister_single(con, name):
+ if con.name not in _modules:
+ return
+ if name not in _modules[con.name]:
+ return
+ del _modules[con.name][name]
+
+
def get(account, name):
try:
return _modules[account][name]
=====================================
gajim/gtk/account_wizard.py
=====================================
--- a/gajim/gtk/account_wizard.py
+++ b/gajim/gtk/account_wizard.py
@@ -288,6 +288,7 @@ class AccountCreationWizard:
100, self.update_progressbar)
# Get form from serveur
con = connection.Connection(self.account)
+ app.plugin_manager.register_modules_for_account(con)
app.connections[self.account] = con
con.new_account(self.account, config)
elif cur_page == 3:
=====================================
gajim/plugins/pluginmanager.py
=====================================
--- a/gajim/plugins/pluginmanager.py
+++ b/gajim/plugins/pluginmanager.py
@@ -38,6 +38,7 @@ import gajim
from gajim.common import app
from gajim.common import nec
from gajim.common import configpaths
+from gajim.common import modules
from gajim.common.exceptions import PluginsystemError
from gajim.plugins.helpers import log, log_calls, Singleton
@@ -352,6 +353,38 @@ class PluginManager(metaclass=Singleton):
if plugin.encryption_name:
del self.encryption_plugins[plugin.encryption_name]
+ def _register_modules_with_handlers(self, plugin):
+ if not hasattr(plugin, 'modules'):
+ return
+ for con in app.connections.values():
+ for module in plugin.modules:
+ instance, name = module.get_instance(con)
+ if not module.zeroconf and con.name == 'Local':
+ continue
+ modules.register_single(con, instance, name)
+
+ # If handlers have been registered, register the
+ # plugin handlers. Otherwise this will be done
+ # automatically on connecting
+ # in connection_handlers._register_handlers()
+ if con.handlers_registered:
+ for handler in instance.handlers:
+ con.connection.RegisterHandler(*handler)
+
+ def _unregister_modules_with_handlers(self, plugin):
+ if not hasattr(plugin, 'modules'):
+ return
+ for con in app.connections.values():
+ for module in plugin.modules:
+ instance = con.get_module(module.name)
+ modules.unregister_single(con, module.name)
+
+ # Account is still connected and handlers are registered
+ # So just unregister the plugin handlers
+ if con.handlers_registered:
+ for handler in instance.handlers:
+ con.connection.UnregisterHandler(*handler)
+
@log_calls('PluginManager')
def activate_plugin(self, plugin):
'''
@@ -365,6 +398,7 @@ class PluginManager(metaclass=Singleton):
self._handle_all_gui_extension_points_with_plugin(plugin)
self._register_events_handlers_in_ged(plugin)
self._register_network_events_in_nec(plugin)
+ self._register_modules_with_handlers(plugin)
self.active_plugins.append(plugin)
try:
@@ -402,6 +436,7 @@ class PluginManager(metaclass=Singleton):
self._remove_events_handler_from_ged(plugin)
self._remove_network_events_from_nec(plugin)
self._remove_name_from_encryption_plugins(plugin)
+ self._unregister_modules_with_handlers(plugin)
# removing plug-in from active plug-ins list
plugin.deactivate()
@@ -462,6 +497,24 @@ class PluginManager(metaclass=Singleton):
except GajimPluginActivateException:
pass
+ def register_modules_for_account(self, con):
+ '''
+ A new account has been added, register modules
+ of all active plugins
+ '''
+ for plugin in self.plugins:
+ if not plugin.active:
+ return
+
+ if not hasattr(plugin, 'modules'):
+ return
+
+ for module in plugin.modules:
+ instance, name = module.get_instance(con)
+ if not module.zeroconf and con.name == 'Local':
+ continue
+ modules.register_single(con, instance, name)
+
def _plugin_is_active_in_global_config(self, plugin):
return app.config.get_per('plugins', plugin.short_name, 'active')
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/931e3f60ba8bcf707193ca897ede931e89…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/931e3f60ba8bcf707193ca897ede931e89…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3c492e92 by Sophie Herold at 2018-08-28T20:33:12Z
Show avatar in new message notifications
- - - - -
1 changed file:
- gajim/notify.py
Changes:
=====================================
gajim/notify.py
=====================================
--- a/gajim/notify.py
+++ b/gajim/notify.py
@@ -180,7 +180,6 @@ class Notification:
notification.set_title(title)
if text is not None:
notification.set_body(text)
- notification.set_icon(icon_pixbuf)
notif_id = None
if event_type in (_('Contact Signed In'), _('Contact Signed Out'),
_('New Message'), _('New Single Message'), _('New Private Message'),
@@ -211,9 +210,14 @@ class Notification:
notif_id = self._id('connection-failed', account)
elif event_type in (_('New Message'), _('New Single Message'),
_('New Private Message')):
+ avatar = app.contacts.get_avatar(account, jid)
+ if avatar:
+ icon_pixbuf = avatar
notif_id = self._id('new-message', account, jid)
+ notification.set_icon(icon_pixbuf)
notification.set_priority(Gio.NotificationPriority.NORMAL)
+
app.app.send_notification(notif_id, notification)
def withdraw(self, *args):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3c492e92da7fdcd4e6a456820ddd697d4f…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3c492e92da7fdcd4e6a456820ddd697d4f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d57bfcbc by Philipp Hörist at 2018-08-26T08:39:29Z
ServerInfo: Fix empty version result
Fixes #9311
- - - - -
1 changed file:
- gajim/gtk/server_info.py
Changes:
=====================================
gajim/gtk/server_info.py
=====================================
--- a/gajim/gtk/server_info.py
+++ b/gajim/gtk/server_info.py
@@ -129,7 +129,7 @@ class ServerInfoDialog(Gtk.Dialog):
def _nec_version_result_received(self, obj):
if obj.jid != self.hostname:
return
- self.version = obj.client_info
+ self.version = obj.client_info or _('Unknown')
self.update(self.get_infos, self.info_listbox)
def _server_disco_received(self, obj):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d57bfcbcad543e47c3c63548f9aa49036e…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d57bfcbcad543e47c3c63548f9aa49036e…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch gajim_1.1 at gajim / gajim
Commits:
6e8f064f by Philipp Hörist at 2018-08-26T08:38:42Z
ServerInfo: Fix empty version result
Fixes #9311
- - - - -
1 changed file:
- gajim/gtk/server_info.py
Changes:
=====================================
gajim/gtk/server_info.py
=====================================
--- a/gajim/gtk/server_info.py
+++ b/gajim/gtk/server_info.py
@@ -129,7 +129,7 @@ class ServerInfoDialog(Gtk.Dialog):
def _nec_version_result_received(self, obj):
if obj.jid != self.hostname:
return
- self.version = obj.client_info
+ self.version = obj.client_info or _('Unknown')
self.update(self.get_infos, self.info_listbox)
def _server_disco_received(self, obj):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6e8f064fd02bf60f80bd567a5990c05379…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6e8f064fd02bf60f80bd567a5990c05379…
You're receiving this email because of your account on dev.gajim.org.