Commit 7e9d331b authored by Martin's avatar Martin

Imported upstream master from 2017-11-11

parent 0aba4647
......@@ -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):
......
......@@ -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('_', '__')
......@@ -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:
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment