Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
e5773ba9 by Philipp Hörist at 2019-03-10T15:53:11Z
Use count of parameters instead of name
- - - - -
1 changed file:
- nbxmpp/dispatcher.py
Changes:
=====================================
nbxmpp/dispatcher.py
=====================================
@@ -617,7 +617,7 @@ class XMPPDispatcher(PlugIn):
# Backwards compatibility until all handlers support
# properties
signature = inspect.signature(handler['func'])
- if 'properties' in signature.parameters:
+ if len(signature.parameters) > 2:
handler['func'](session, stanza, properties)
else:
handler['func'](session, stanza)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/e5773ba9221401ee40a1893e6c…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/e5773ba9221401ee40a1893e6c…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0eb75eb7 by Philipp Hörist at 2019-03-10T09:06:45Z
Modules: Use LogAdapter
- Make all modules inherit from BaseModule
- Use LogAdapter in BaseModule
- - - - -
b80bbaf2 by Philipp Hörist at 2019-03-10T09:07:12Z
Improve log message format
- - - - -
30 changed files:
- gajim/common/logging_helpers.py
- gajim/common/modules/adhoc_commands.py
- gajim/common/modules/annotations.py
- gajim/common/modules/base.py
- gajim/common/modules/bits_of_binary.py
- gajim/common/modules/blocking.py
- gajim/common/modules/bookmarks.py
- gajim/common/modules/caps.py
- gajim/common/modules/carbons.py
- gajim/common/modules/chatstates.py
- gajim/common/modules/delimiter.py
- gajim/common/modules/discovery.py
- gajim/common/modules/entity_time.py
- gajim/common/modules/gateway.py
- gajim/common/modules/http_auth.py
- gajim/common/modules/httpupload.py
- gajim/common/modules/iq.py
- gajim/common/modules/last_activity.py
- gajim/common/modules/mam.py
- gajim/common/modules/message.py
- gajim/common/modules/metacontacts.py
- gajim/common/modules/muc.py
- gajim/common/modules/pep.py
- gajim/common/modules/ping.py
- gajim/common/modules/presence.py
- gajim/common/modules/privacylists.py
- gajim/common/modules/pubsub.py
- gajim/common/modules/receipts.py
- gajim/common/modules/register.py
- gajim/common/modules/roster.py
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/6e672c991187f383d950f0cf692af6748…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/6e672c991187f383d950f0cf692af6748…
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:
6d9d8f72 by Philipp Hörist at 2019-03-06T22:19:59Z
Dont allow setting invalid show values
- - - - -
1 changed file:
- nbxmpp/protocol.py
Changes:
=====================================
nbxmpp/protocol.py
=====================================
@@ -1261,6 +1261,8 @@ class Presence(Protocol):
"""
Set the show value of the message
"""
+ if val not in ['away', 'chat', 'dnd', 'xa']:
+ raise ValueError('Invalid show value: %s' % val)
self.setTagData('show', val)
def setStatus(self, val):
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/6d9d8f722a7d247b7aa16ec80f…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/6d9d8f722a7d247b7aa16ec80f…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
b704e27a by Philipp Hörist at 2019-03-06T22:03:45Z
Write correct show values to database
Since the refactor we wrote accidentally string instead of int
- - - - -
3 changed files:
- gajim/common/helpers.py
- gajim/common/modules/presence.py
- gajim/history_manager.py
Changes:
=====================================
gajim/common/helpers.py
=====================================
@@ -56,6 +56,7 @@ from gajim.common import configpaths
from gajim.common.i18n import Q_
from gajim.common.i18n import _
from gajim.common.i18n import ngettext
+from gajim.common.const import ShowConstant
log = logging.getLogger('gajim.c.helpers')
@@ -246,6 +247,9 @@ def get_uf_show(show, use_mnemonic=False):
If use_mnemonic is True, it adds _ so GUI should call with True for
accessibility issues
"""
+ if isinstance(show, ShowConstant):
+ show = show.name.lower()
+
if show == 'dnd':
if use_mnemonic:
uf_show = _('_Busy')
=====================================
gajim/common/modules/presence.py
=====================================
@@ -25,6 +25,7 @@ from gajim.common import app
from gajim.common.i18n import _
from gajim.common.nec import NetworkEvent
from gajim.common.const import KindConstant
+from gajim.common.const import ShowConstant
from gajim.common.helpers import prepare_and_validate_gpg_keyID
log = logging.getLogger('gajim.c.m.presence')
@@ -236,11 +237,9 @@ class Presence:
if not app.config.should_log(self._account, properties.jid.getBare()):
return
- # TODO: Refactor
+ show = ShowConstant[properties.show.name]
if properties.type.is_unavailable:
- show = 'offline'
- else:
- show = properties.show.value
+ show = ShowConstant.OFFLINE
app.logger.insert_into_logs(self._account,
properties.jid.getBare(),
=====================================
gajim/history_manager.py
=====================================
@@ -50,6 +50,7 @@ from gajim.common.i18n import _
from gajim.common.const import StyleAttr
from gajim.common.const import JIDConstant
from gajim.common.const import KindConstant
+from gajim.common.const import ShowConstant
def is_standalone():
# Determine if we are in standalone mode
@@ -398,7 +399,8 @@ class HistoryManager:
message = ''
else:
message = ' : ' + message
- message = helpers.get_uf_show(show) + message
+
+ message = helpers.get_uf_show(ShowConstant(show)) + message
message_ = '<span'
if color:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/b704e27abcb831f0ad2cc9d5d743352f4e…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/b704e27abcb831f0ad2cc9d5d743352f4e…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
5e97d805 by Philipp Hörist at 2019-03-06T21:14:57Z
HistoryManager: Display show value correctly
- - - - -
1 changed file:
- gajim/history_manager.py
Changes:
=====================================
gajim/history_manager.py
=====================================
@@ -398,8 +398,7 @@ class HistoryManager:
message = ''
else:
message = ' : ' + message
- message = helpers.get_uf_show(app.SHOW_LIST[show]) + \
- message
+ message = helpers.get_uf_show(show) + message
message_ = '<span'
if color:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5e97d805d970ef6ce596b2730d39b8e407…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5e97d805d970ef6ce596b2730d39b8e407…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
872ee3d6 by Philipp Hörist at 2019-03-06T21:11:35Z
Fix presence subscription
Fixes #9612
- - - - -
1 changed file:
- gajim/common/modules/presence.py
Changes:
=====================================
gajim/common/modules/presence.py
=====================================
@@ -174,7 +174,9 @@ class Presence:
else:
# Convert the inital roster contact to a contact with resource
contact.resource = resource
- event.old_show = status_strings.index(contact.show)
+ event.old_show = 0
+ if contact.show in status_strings:
+ event.old_show = status_strings.index(contact.show)
event.need_add_in_roster = True
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/872ee3d6753912629f000e8cf7114c9105…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/872ee3d6753912629f000e8cf7114c9105…
You're receiving this email because of your account on dev.gajim.org.