Yann Leboulanger pushed to branch master at gajim / gajim

Commits:

4 changed files:

Changes:

  • src/common/config.py
    ... ... @@ -325,7 +325,7 @@ class Config:
    325 325
                         'client_cert_encrypted': [ opt_bool, False, '', False ],
    
    326 326
                         'savepass': [ opt_bool, False ],
    
    327 327
                         'password': [ opt_str, '' ],
    
    328
    -                    'resource': [ opt_str, 'gajim', '', True ],
    
    328
    +                    'resource': [ opt_str, 'gajim.$rand', '', True ],
    
    329 329
                         'priority': [ opt_int, 5, '', True ],
    
    330 330
                         'adjust_priority_with_status': [ opt_bool, True, _('Priority will change automatically according to your status. Priorities are defined in autopriority_* options.') ],
    
    331 331
                         'autopriority_online': [ opt_int, 50],
    

  • src/common/connection.py
    ... ... @@ -36,7 +36,7 @@ import os
    36 36
     import random
    
    37 37
     import socket
    
    38 38
     import operator
    
    39
    -
    
    39
    +import string
    
    40 40
     import time
    
    41 41
     import locale
    
    42 42
     import hmac
    
    ... ... @@ -182,8 +182,10 @@ class CommonConnection:
    182 182
             resource = gajim.config.get_per('accounts', self.name, 'resource')
    
    183 183
             # All valid resource substitution strings should be added to this hash.
    
    184 184
             if resource:
    
    185
    +            rand = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(8))
    
    185 186
                 resource = Template(resource).safe_substitute({
    
    186
    -                    'hostname': socket.gethostname()
    
    187
    +                    'hostname': socket.gethostname(),
    
    188
    +                    'rand': rand
    
    187 189
                 })
    
    188 190
             return resource
    
    189 191
     
    

  • src/common/helpers.py
    ... ... @@ -1078,13 +1078,14 @@ def get_notification_icon_tooltip_dict():
    1078 1078
                                 messages[jid], messages[jid], messages[jid])
    
    1079 1079
                         contact = gajim.contacts.get_first_contact_from_jid(
    
    1080 1080
                                 account['name'], jid)
    
    1081
    +                    text += ' '
    
    1081 1082
                         if jid in gajim.gc_connected[account['name']]:
    
    1082
    -                        text += _(' from room %s') % (jid)
    
    1083
    +                        text += _('from room %s') % (jid)
    
    1083 1084
                         elif contact:
    
    1084 1085
                             name = contact.get_shown_name()
    
    1085
    -                        text += _(' from user %s') % (name)
    
    1086
    +                        text += _('from user %s') % (name)
    
    1086 1087
                         else:
    
    1087
    -                        text += _(' from %s') % (jid)
    
    1088
    +                        text += _('from %s') % (jid)
    
    1088 1089
                         account['event_lines'].append(text)
    
    1089 1090
     
    
    1090 1091
             # Display unseen events numbers, if any
    
    ... ... @@ -1099,7 +1100,7 @@ def get_notification_icon_tooltip_dict():
    1099 1100
                     for jid in non_messages.keys():
    
    1100 1101
                         text = ngettext('%d event pending', '%d events pending',
    
    1101 1102
                             non_messages[jid], non_messages[jid], non_messages[jid])
    
    1102
    -                    text += _(' from user %s') % (jid)
    
    1103
    +                    text += ' ' + _('from user %s') % (jid)
    
    1103 1104
                         account[account]['event_lines'].append(text)
    
    1104 1105
     
    
    1105 1106
         return accounts
    

  • src/common/multimedia_helpers.py
    ... ... @@ -37,7 +37,7 @@ class DeviceManager(object):
    37 37
                     element.set_state(Gst.State.READY)
    
    38 38
                     devices = element.get_properties('device')
    
    39 39
                     if devices:
    
    40
    -                    self.devices[text % _(' Default device')] = pipe % name
    
    40
    +                    self.devices[text % _('Default device')] = pipe % name
    
    41 41
                         for device in devices:
    
    42 42
                             element.set_state(Gst.State.NULL)
    
    43 43
                             element.set_property('device', device)