Philipp Hörist pushed to branch master at gajim / gajim
Commits:
c1c2a92e by Philipp Hörist at 2017-11-18T11:11:47+01:00
Init Plugins and Caps after Roster
- Some plugins do not depend on gui extension points and need the
roster to be initialized
- - - - -
1 changed file:
- gajim/gui_interface.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2562,6 +2562,20 @@ class Interface:
MessageWindowMgr.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER:
self.msg_win_mgr.create_window(None, None, None)
+ # Creating plugin manager
+ from gajim import plugins
+ app.plugin_manager = plugins.PluginManager()
+ app.plugin_manager.init_plugins()
+
+ helpers.update_optional_features()
+ # prepopulate data which we are sure of; note: we do not log these info
+ for account in app.connections:
+ gajimcaps = caps_cache.capscache[
+ ('sha-1', app.caps_hash[account])]
+ gajimcaps.identities = [app.gajim_identity]
+ gajimcaps.features = app.gajim_common_features + \
+ app.gajim_optional_features[account]
+
self.roster._before_fill()
for account in app.connections:
app.connections[account].load_roster_from_db()
@@ -2758,20 +2772,6 @@ class Interface:
app.gajim_optional_features[a] = []
app.caps_hash[a] = ''
- # Creating plugin manager
- from gajim import plugins
- app.plugin_manager = plugins.PluginManager()
- app.plugin_manager.init_plugins()
-
- helpers.update_optional_features()
- # prepopulate data which we are sure of; note: we do not log these info
- for account in app.connections:
- gajimcaps = caps_cache.capscache[('sha-1',
- app.caps_hash[account])]
- gajimcaps.identities = [app.gajim_identity]
- gajimcaps.features = app.gajim_common_features + \
- app.gajim_optional_features[account]
-
self.remote_ctrl = None
from gajim import network_watcher
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c1c2a92efccbc89e625e27ff5129bb4984…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c1c2a92efccbc89e625e27ff5129bb4984…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0fe78daa by Philipp Hörist at 2017-11-15T21:57:15+01:00
Init PluginManger earlier
- Plugins need the possibility to add caps before Gajim updates them
- - - - -
775fec2f by Philipp Hörist at 2017-11-15T22:26:55+01:00
Dont activate plugins in PluginManager init
Plugins maybe want to use in their activation Gajim methods that
use an extension point. But because the PluginManager Object is not fully
initialized, the extension point method is not available yet
First create the PluginManager Object, then load Plugins.
- - - - -
d5ddbe37 by Philipp Hörist at 2017-11-15T22:28:11+01:00
Add extension point for plugins to add their caps
- - - - -
9f0154ef by Philipp Hörist at 2017-11-15T22:28:57+01:00
Add caps to first presence
According to the XEP, caps hash has to be added to all presences
- - - - -
4 changed files:
- gajim/common/connection_handlers.py
- gajim/common/helpers.py
- gajim/gui_interface.py
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -2039,6 +2039,7 @@ ConnectionHandlersBase, ConnectionJingle, ConnectionIBBytestream):
p.setStatus(msg)
if signed:
p.setTag(nbxmpp.NS_SIGNED + ' x').setData(signed)
+ p = self.add_sha(p)
if self.connection:
self.connection.send(p)
=====================================
gajim/common/helpers.py
=====================================
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -1354,6 +1354,10 @@ def update_optional_features(account = None):
app.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_XTLS)
app.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_BYTESTREAM)
app.gajim_optional_features[a].append(nbxmpp.NS_JINGLE_IBB)
+
+ # Give plugins the possibility to add their features
+ app.plugin_manager.extension_point('update_caps', a)
+
app.caps_hash[a] = caps_cache.compute_caps_hash([app.gajim_identity],
app.gajim_common_features + app.gajim_optional_features[a])
# re-send presence with new hash
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -2562,10 +2562,6 @@ class Interface:
MessageWindowMgr.ONE_MSG_WINDOW_ALWAYS_WITH_ROSTER:
self.msg_win_mgr.create_window(None, None, None)
- # Creating plugin manager
- from gajim import plugins
- app.plugin_manager = plugins.PluginManager()
-
self.roster._before_fill()
for account in app.connections:
app.connections[account].load_roster_from_db()
@@ -2762,6 +2758,11 @@ class Interface:
app.gajim_optional_features[a] = []
app.caps_hash[a] = ''
+ # Creating plugin manager
+ from gajim import plugins
+ app.plugin_manager = plugins.PluginManager()
+ app.plugin_manager.init_plugins()
+
helpers.update_optional_features()
# prepopulate data which we are sure of; note: we do not log these info
for account in app.connections:
=====================================
gajim/plugins/pluginmanager.py
=====================================
--- a/gajim/plugins/pluginmanager.py
+++ b/gajim/plugins/pluginmanager.py
@@ -110,7 +110,6 @@ class PluginManager(metaclass=Singleton):
for path in [app.PLUGINS_DIRS[1], app.PLUGINS_DIRS[0]]:
pc = PluginManager.scan_dir_for_plugins(path)
self.add_plugins(pc)
- self._activate_all_plugins_from_global_config()
@log_calls('PluginManager')
def _plugin_has_entry_in_global_config(self, plugin):
@@ -127,6 +126,10 @@ class PluginManager(metaclass=Singleton):
app.config.del_per('plugins', plugin.short_name)
@log_calls('PluginManager')
+ def init_plugins(self):
+ self._activate_all_plugins_from_global_config()
+
+ @log_calls('PluginManager')
def add_plugin(self, plugin_class):
'''
:todo: what about adding plug-ins that are already added? Module reload
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/5236693df9f5855888411bcaaed41b01f…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/5236693df9f5855888411bcaaed41b01f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
5236693d by Philipp Hörist at 2017-11-11T21:46:00+01:00
Parse stanza-id in groupchat correctly
- - - - -
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
@@ -148,10 +148,14 @@ class HelperEvent:
if by is None:
# We can not verify who set this stanza-id, ignore it.
return
- elif not self.conn.get_own_jid().bareMatch(by):
- # by attribute does not match the server, ignore it.
- return
- return stanza_id
+ if stanza.getType() == 'groupchat':
+ if stanza.getFrom().bareMatch(by):
+ # by attribute must match the server
+ return stanza_id
+ elif self.conn.get_own_jid().bareMatch(by):
+ # by attribute must match the server
+ return stanza_id
+ return
@staticmethod
def get_forwarded_message(stanza):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5236693df9f5855888411bcaaed41b01f3…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5236693df9f5855888411bcaaed41b01f3…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
309e844b by Philipp Hörist at 2017-11-11T17:10:31+01:00
Escape account label in roster and menus
- - - - -
2 changed files:
- gajim/gui_menu_builder.py
- gajim/roster_window.py
Changes:
=====================================
gajim/gui_menu_builder.py
=====================================
--- a/gajim/gui_menu_builder.py
+++ b/gajim/gui_menu_builder.py
@@ -780,7 +780,8 @@ def build_accounts_menu():
return
if len(accounts_list) > 1:
for acc in accounts_list:
- label = app.config.get_per('accounts', acc, 'account_label')
+ label = escape_mnemonic(
+ app.config.get_per('accounts', acc, 'account_label'))
acc_menu.append_submenu(
label or acc, get_account_menu(acc))
else:
@@ -806,8 +807,8 @@ def build_bookmark_menu(account):
if acc_menu.get_item_link(0, 'submenu'):
for i in range(acc_menu.get_n_items()):
label = acc_menu.get_item_attribute_value(i, 'label')
- account_label = app.config.get_per('accounts', account,
- 'account_label')
+ account_label = escape_mnemonic(
+ app.config.get_per('accounts', account, 'account_label'))
if label.get_string() in (account_label, account):
menu = acc_menu.get_item_link(i, 'submenu')
else:
@@ -835,3 +836,11 @@ def get_encryption_menu(control_id, type_id):
if menu.get_n_items() == 1:
return None
return menu
+
+
+def escape_mnemonic(label):
+ if label is None:
+ return
+ # Underscore inside a label means the next letter is a keyboard
+ # shortcut. To show an underscore we have to use double underscore
+ return label.replace('_', '__')
=====================================
gajim/roster_window.py
=====================================
--- a/gajim/roster_window.py
+++ b/gajim/roster_window.py
@@ -1069,7 +1069,7 @@ class RosterWindow:
accounts = accounts)
account_name += ' (%s/%s)' % (repr(nbr_on), repr(nbr_total))
- self.model[child_iter][Column.NAME] = account_name
+ self.model[child_iter][Column.NAME] = GLib.markup_escape_text(account_name)
pep_dict = app.connections[account].pep
if app.config.get('show_mood_in_roster') and 'mood' in pep_dict:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/309e844b4ee853c1dbb17108e517ff38e9…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/309e844b4ee853c1dbb17108e517ff38e9…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d19e87eb by Philipp Hörist at 2017-11-10T18:09:36+01:00
Fix showing normal message event
Regression introduced in 9b866fd1a05ddd37d70aecda9c605d20403afe92
- - - - -
1 changed file:
- gajim/session.py
Changes:
=====================================
gajim/session.py
=====================================
--- a/gajim/session.py
+++ b/gajim/session.py
@@ -262,7 +262,7 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
self.conn.name, contact, self)
obj.show_in_systray = notify.get_show_in_systray(event_type,
self.conn.name, contact)
- if obj.mtype == 'normal' and not obj.popup:
+ if obj.mtype == 'normal' and obj.popup:
do_event = False
else:
do_event = True
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d19e87eb7b98f1d24455a8e0c90a4ecb7d…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d19e87eb7b98f1d24455a8e0c90a4ecb7d…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
947106bb by Philipp Hörist at 2017-11-09T20:57:03+01:00
Catch more errors on vCard request
- - - - -
1 changed file:
- gajim/common/connection_handlers.py
Changes:
=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -471,13 +471,18 @@ class ConnectionVcard:
jid = frm_jid.getStripped()
stanza_error = stanza.getError()
- if stanza_error in ('service-unavailable', 'item-not-found'):
+ if stanza_error in ('service-unavailable', 'item-not-found',
+ 'not-allowed'):
app.log('avatar').info('vCard not available: %s %s',
- jid, stanza_error)
+ frm_jid, stanza_error)
return
- vcard = self._node_to_dict(
- stanza.getTag('vCard', namespace=nbxmpp.NS_VCARD))
+ vcard_node = stanza.getTag('vCard', namespace=nbxmpp.NS_VCARD)
+ if vcard_node is None:
+ app.log('avatar').info('vCard not available: %s', frm_jid)
+ app.log('avatar').debug(stanza)
+ return
+ vcard = self._node_to_dict(vcard_node)
if self.get_own_jid().bareMatch(jid):
if 'NICKNAME' in vcard:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/947106bb661f00feee4b79e69fee9d2d6f…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/947106bb661f00feee4b79e69fee9d2d6f…
You're receiving this email because of your account on dev.gajim.org.