Philipp Hörist pushed to branch master at gajim / gajim
Commits:
df22a60c by wurstsalat at 2020-09-26T10:41:20+02:00
Events: Don’t fire signal before removing remaining events
- - - - -
61de0674 by wurstsalat at 2020-09-26T10:41:20+02:00
SubscriptionRequest: Remove remaining events on block/report
- - - - -
08ea859a by wurstsalat at 2020-09-26T10:41:20+02:00
Roster: Remove remaining events on block/report
- - - - -
3 changed files:
- gajim/common/events.py
- gajim/gtk/subscription_request.py
- gajim/roster_window.py
Changes:
=====================================
gajim/common/events.py
=====================================
@@ -280,9 +280,10 @@ class Events:
del self._events[account][jid]
self.fire_event_removed(removed_list)
return
- # no event nor type given, remove them all
- self.fire_event_removed(self._events[account][jid])
+ # No event nor type given, remove them all
+ removed_list = self._events[account][jid]
del self._events[account][jid]
+ self.fire_event_removed(removed_list)
def change_jid(self, account, old_jid, new_jid):
if account not in self._events:
=====================================
gajim/gtk/subscription_request.py
=====================================
@@ -104,12 +104,14 @@ class SubscriptionRequest(Gtk.ApplicationWindow):
self._remove_contact()
def _on_block_clicked(self, _widget):
+ app.events.remove_events(self.account, self.jid)
self._deny_request()
con = app.connections[self.account]
con.get_module('Blocking').block([self.jid])
self._remove_contact()
def _on_report_clicked(self, _widget):
+ app.events.remove_events(self.account, self.jid)
self._deny_request()
con = app.connections[self.account]
con.get_module('Blocking').block([self.jid], report='spam')
=====================================
gajim/roster_window.py
=====================================
@@ -2638,6 +2638,7 @@ class RosterWindow:
jid_list = [contact.jid for contact in l_]
con.get_module('Blocking').block(jid_list, report)
for contact in l_:
+ app.events.remove_events(acct, contact.jid)
ctrl = app.interface.msg_win_mgr.get_control(
contact.jid, acct)
if ctrl:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/c8d19f60b5aa149291768b37c4cf0e6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/c8d19f60b5aa149291768b37c4cf0e6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d296f05b by lovetox at 2020-09-25T20:36:36+02:00
GroupChatControl: Fix undefined variable
- - - - -
1 changed file:
- gajim/groupchat_control.py
Changes:
=====================================
gajim/groupchat_control.py
=====================================
@@ -577,7 +577,7 @@ class GroupchatControl(ChatControlBase):
return
vcard = VCard()
- vcard.set_avatar(avatar, 'image/png')
+ vcard.set_avatar(data, 'image/png')
con = app.connections[self.account]
con.get_module('VCardTemp').set_vcard(
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d296f05bf029001822bc488d0bed6d17…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d296f05bf029001822bc488d0bed6d17…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a316c6dd by lovetox at 2020-09-25T20:35:38+02:00
GroupChatControl: Don’t encode avatar
This is already done by set_avatar()
- - - - -
1 changed file:
- gajim/groupchat_control.py
Changes:
=====================================
gajim/groupchat_control.py
=====================================
@@ -576,7 +576,6 @@ class GroupchatControl(ChatControlBase):
self.add_info_message(_('Loading avatar failed'))
return
- avatar = base64.b64encode(data).decode('utf-8')
vcard = VCard()
vcard.set_avatar(avatar, 'image/png')
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a316c6ddffcd4119527b43e67951bdaa…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a316c6ddffcd4119527b43e67951bdaa…
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:
854caebc by lovetox at 2020-09-25T19:21:23+02:00
Task: Catch CancelledError when invoking callbacks
So callback methods don’t need to catch it they don’t need to handle
it specially
- - - - -
1 changed file:
- nbxmpp/task.py
Changes:
=====================================
nbxmpp/task.py
=====================================
@@ -207,7 +207,13 @@ class Task:
if callback is None:
return
- callback(self)
+ # Be conservative with catching exceptions here
+ # For example unittests raise Assertion errors
+ # which should not be catched here
+ try:
+ callback(self)
+ except CancelledError:
+ pass
def set_result(self, result):
self._result = result
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/854caebc7a441854f79be39d…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/854caebc7a441854f79be39d…
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:
aa7791fe by lovetox at 2020-09-25T17:09:34+02:00
TCP: Catch RuntimeError also on _on_read_async_finish()
- - - - -
0dee8510 by lovetox at 2020-09-25T17:17:39+02:00
TCP: Add more debug logging
- - - - -
1 changed file:
- nbxmpp/tcp.py
Changes:
=====================================
nbxmpp/tcp.py
=====================================
@@ -226,6 +226,12 @@ class TCPConnection(Connection):
self._finalize('disconnected')
return
+ except RuntimeError as error:
+ # PyGObject raises a RuntimeError when it fails to convert the
+ # GError. Why it failed is printed by PyGObject
+ self._log.error(error)
+ return
+
data = data.get_data()
if not data:
if self._state == TCPState.DISCONNECTING:
@@ -238,7 +244,15 @@ class TCPConnection(Connection):
self._renew_keepalive_timer()
self._read_buffer += data
- data, self._read_buffer = utf8_decode(self._read_buffer)
+
+ try:
+ data, self._read_buffer = utf8_decode(self._read_buffer)
+ except UnicodeDecodeError as error:
+ self._log.warning(error)
+ self._log.warning('read buffer: "%s"', self._read_buffer)
+ self._log.warning('data: "%s"', data)
+ self._finalize('disconnected')
+ return
self._log_stanza(data, received=True)
@@ -287,9 +301,8 @@ class TCPConnection(Connection):
return
except RuntimeError as error:
- # PyGObject raises a RuntimeError when it failed to for some reason
- # to convert the GError. Why it failed to convert is printed by
- # PyGObject
+ # PyGObject raises a RuntimeError when it fails to convert the
+ # GError. Why it failed is printed by PyGObject
self._log.error(error)
return
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/29212faaaa0472960770553…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/29212faaaa0472960770553…
You're receiving this email because of your account on dev.gajim.org.