Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d498dbf1 by Philipp Hörist at 2020-01-26T22:28:18+01:00
1.1.93
- - - - -
1 changed file:
- gajim/__init__.py
Changes:
=====================================
gajim/__init__.py
=====================================
@@ -1,7 +1,7 @@
import os
import subprocess
-__version__ = "1.1.92"
+__version__ = "1.1.93"
IS_FLATPAK = False
if os.path.exists('/app/share/run-as-flatpak'):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d498dbf1382a67d6f47e4cf0ed3267e2ef…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/d498dbf1382a67d6f47e4cf0ed3267e2ef…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3a4006ec by Philipp Hörist at 2020-01-26T22:26:21+01:00
Roster: Correctly process roster item updates
A roster push contains always the whole entry, so instead of updating
only the attributes which are present in the roster push, fill all missing
attrs with default values, e.g. None for a missing name attr
Fixes #9963
- - - - -
1 changed file:
- gajim/common/modules/roster.py
Changes:
=====================================
gajim/common/modules/roster.py
=====================================
@@ -149,34 +149,33 @@ class Roster(BaseModule):
for item in query.getTags('item'):
jid = item.getAttr('jid')
- self._data[jid] = self._get_item_attrs(item, update=False)
+ self._data[jid] = self._get_item_attrs(item)
self._log.info('Item %s: %s', jid, self._data[jid])
return version
@staticmethod
- def _get_item_attrs(item, update=True):
+ def _get_item_attrs(item, update=False):
'''
update: True
- returns only the attrs that are present in the item
+ Omit avatar_sha from the returned attrs
update: False
- returns the attrs of the item but fills missing
- attrs with default values
+ Include the default value fro avatar_sha in the returned attrs
'''
default_attrs = {'name': None,
'ask': None,
'subscription': None,
- 'groups': [],
- 'avatar_sha': None}
+ 'groups': []}
+
+ if not update:
+ default_attrs['avatar_sha'] = None
attrs = item.getAttrs()
del attrs['jid']
groups = {group.getData() for group in item.getTags('group')}
attrs['groups'] = list(groups)
- if update:
- return attrs
default_attrs.update(attrs)
return default_attrs
@@ -196,13 +195,13 @@ class Roster(BaseModule):
if item.getAttr('subscription') == 'remove':
self._data.pop(jid, None)
- attrs = self._get_item_attrs(item, update=False)
+ attrs = self._get_item_attrs(item)
return RosterItem(jid, attrs)
if jid not in self._data:
- self._data[jid] = self._get_item_attrs(item, update=False)
+ self._data[jid] = self._get_item_attrs(item)
else:
- self._data[jid].update(self._get_item_attrs(item))
+ self._data[jid].update(self._get_item_attrs(item, update=True))
return RosterItem(jid, self._data[jid])
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3a4006ecbfde2282b2d9c0b202c9d739fe…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3a4006ecbfde2282b2d9c0b202c9d739fe…
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:
8c4bbc69 by Philipp Hörist at 2020-01-26T21:11:12+01:00
OMEMO: Make return value consistent for request_devicelist()
Always return a list instead of in some cases None
Fixes #96
- - - - -
1 changed file:
- nbxmpp/modules/omemo.py
Changes:
=====================================
nbxmpp/modules/omemo.py
=====================================
@@ -173,7 +173,7 @@ class OMEMO:
raise StanzaMalformed('No list node found')
if not list_node.getChildren():
- return None
+ return []
result = []
devices_nodes = list_node.getChildren()
@@ -210,7 +210,7 @@ class OMEMO:
items_node = pubsub_node.getTag('items')
item = items_node.getTag('item')
if item is None:
- return None
+ return []
try:
return self._parse_devicelist(item)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/8c4bbc694a75cc708ddae6890c…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/8c4bbc694a75cc708ddae6890c…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
074e56a8 by Bronko at 2020-01-25T22:57:15+01:00
Connection: Enable SoftwareVersion module
closes #9961
- - - - -
1 changed file:
- gajim/common/connection.py
Changes:
=====================================
gajim/common/connection.py
=====================================
@@ -1487,6 +1487,7 @@ class Connection(CommonConnection, ConnectionHandlers):
self.get_module('VCardTemp').request_vcard()
self.get_module('Bookmarks').request_bookmarks()
+ self.get_module('SoftwareVersion').set_enabled(True)
self.get_module('Annotations').request_annotations()
self.get_module('Blocking').get_blocking_list()
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/074e56a8e023a2e4d0348e9127586a91e7…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/074e56a8e023a2e4d0348e9127586a91e7…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
2b755d2d by Bronko at 2020-01-25T19:59:41+01:00
ConversationsTextview: Remove fuzzy timestamps
- Change default timestamp to include date
closes #9272
- - - - -
4 changed files:
- gajim/common/config.py
- gajim/common/optparser.py
- gajim/conversation_textview.py
- gajim/history_manager.py
Changes:
=====================================
gajim/common/config.py
=====================================
@@ -152,7 +152,7 @@ class Config:
'history_window_x-position': [opt_int, 0],
'history_window_y-position': [opt_int, 0],
'latest_disco_addresses': [opt_str, ''],
- 'time_stamp': [opt_str, '[%X] ', _('This option lets you customize the timestamp that is printed in conversation. For example \'[%H:%M] \' will show \'[hour:minute] \'. See python doc on strftime for full documentation (https://docs.python.org/3/library/time.html).')],
+ 'time_stamp': [opt_str, '%x | %X ', _('This option lets you customize the timestamp that is printed in conversation. For example \'[%H:%M] \' will show \'[hour:minute] \'. See python doc on strftime for full documentation (https://docs.python.org/3/library/time.html#time.strftime).')],
'before_nickname': [opt_str, '', _('Characters that are printed before the nickname in conversations.')],
'after_nickname': [opt_str, ':', _('Characters that are printed after the nickname in conversations.')],
'change_roster_title': [opt_bool, True, _('If enabled, Gajim will add * and [n] in contact list window title.')],
=====================================
gajim/common/optparser.py
=====================================
@@ -146,6 +146,8 @@ class OptionsParser:
self.update_config_to_016105()
if old < [0, 98, 3] and new >= [0, 98, 3]:
self.update_config_to_0983()
+ if old < [1, 1, 93] and new >= [1, 1, 93]:
+ self.update_config_to_1193()
app.config.set('version', new_version)
@@ -212,3 +214,9 @@ class OptionsParser:
elif password == "libsecret:":
app.config.set_per('accounts', account, 'password', '')
app.config.set('version', '0.98.3')
+
+ def update_config_to_1193(self):
+ # add date to time_stamp, if user did not set a custom time_stamp
+ if self.old_values['time_stamp'] == '[%X] ':
+ app.config.set('time_stamp', '%x | %X ')
+ app.config.set('version', '1.1.93')
=====================================
gajim/conversation_textview.py
=====================================
@@ -24,11 +24,9 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
import time
-import os
import queue
import urllib
import logging
-from calendar import timegm
from gi.repository import Gtk
from gi.repository import Pango
@@ -1084,34 +1082,11 @@ class ConversationTextview(GObject.GObject):
self.line += 1
- def get_time_to_show(self, tim, direction_mark=''):
+ def get_time_to_show(self, tim):
"""
- Get the time, with the day before if needed and return it. It DOESN'T
- format a fuzzy time
+ Format the time according to config setting 'time_stamp'
"""
- format_ = ''
- # get difference in days since epoch (86400 = 24*3600)
- # number of days since epoch for current time (in GMT) -
- # number of days since epoch for message (in GMT)
- diff_day = int(int(timegm(time.localtime())) / 86400 -\
- int(timegm(tim)) / 86400)
- if diff_day == 0.0:
- day_str = ''
- else:
- #%i is day in year (1-365)
- day_str = i18n.ngettext('Yesterday',
- '%(nb_days)i days ago', diff_day, {'nb_days': diff_day},
- {'nb_days': diff_day})
- if day_str:
- # strftime Windows bug has problems with Unicode
- # see: http://bugs.python.org/issue8304
- if os.name != 'nt':
- format_ += i18n.direction_mark + day_str + direction_mark + ' '
- else:
- format_ += day_str + ' '
- timestamp_str = app.config.get('time_stamp')
- timestamp_str = helpers.from_one_line(timestamp_str)
- format_ += timestamp_str
+ format_ = helpers.from_one_line(app.config.get('time_stamp'))
tim_format = time.strftime(format_, tim)
return tim_format
@@ -1188,7 +1163,7 @@ class ConversationTextview(GObject.GObject):
current_print_time = app.config.get('print_time')
if current_print_time == 'always':
- timestamp_str = self.get_time_to_show(local_tim, direction_mark)
+ timestamp_str = self.get_time_to_show(local_tim)
timestamp = time.strftime(timestamp_str, local_tim)
timestamp = direction_mark + timestamp + direction_mark
if other_tags_for_time:
@@ -1202,7 +1177,7 @@ class ConversationTextview(GObject.GObject):
seconds_passed = tim - self.last_time_printout
if seconds_passed > every_foo_seconds:
self.last_time_printout = tim
- tim_format = self.get_time_to_show(local_tim, direction_mark)
+ tim_format = self.get_time_to_show(local_tim)
buffer_.insert_with_tags_by_name(iter_, tim_format + '\n',
'time_sometimes')
=====================================
gajim/history_manager.py
=====================================
@@ -364,6 +364,7 @@ class HistoryManager:
self.nickname_col_for_logs.set_visible(False)
self.subject_col_for_logs.set_visible(True)
+ format_ = helpers.from_one_line(app.config.get('time_stamp'))
for row in results:
# exposed in UI (TreeViewColumns) are only
# time, message, subject, nickname
@@ -372,7 +373,7 @@ class HistoryManager:
log_line_id, jid_id, time_, kind, message, subject, nickname, \
show = row
try:
- time_ = time.strftime('%x', time.localtime(float(time_)))
+ time_ = time.strftime(format_, time.localtime(float(time_)))
except ValueError:
pass
else:
@@ -420,6 +421,7 @@ class HistoryManager:
''', (like_sql, like_sql))
results = self.cur.fetchall()
+ format_ = helpers.from_one_line(app.config.get('time_stamp'))
for row in results:
# exposed in UI (TreeViewColumns) are only
# JID, time, message, subject, nickname
@@ -427,7 +429,7 @@ class HistoryManager:
# log_line_id, jid (from jid_id), time, message, subject, nickname
log_line_id, jid_id, time_, message, subject, nickname = row
try:
- time_ = time.strftime('%x', time.localtime(float(time_)))
+ time_ = time.strftime(format_, time.localtime(float(time_)))
except ValueError:
pass
else:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/2b755d2ddbe36b17d1c462cadccb4a81f0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/2b755d2ddbe36b17d1c462cadccb4a81f0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
e86951bd by Philipp Hörist at 2020-01-23T20:09:29+01:00
Remove unused imports
- - - - -
1 changed file:
- gajim/common/zeroconf/client_zeroconf.py
Changes:
=====================================
gajim/common/zeroconf/client_zeroconf.py
=====================================
@@ -20,9 +20,7 @@ import ssl
import errno
import sys
import os
-import string
import logging
-from random import Random
from unittest.mock import Mock
import nbxmpp
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/e86951bd481cee3c4a6051b6a5be4d1f62…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/e86951bd481cee3c4a6051b6a5be4d1f62…
You're receiving this email because of your account on dev.gajim.org.