Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
7a3a6822 by wurstsalat at 2022-05-18T19:30:01+02:00
fix: Don't fail when trying to remove chat history
A group chat from bookmarks could have no history at all,
because Gajim never joined it in the past.
Fixes #10880
- - - - -
1 changed file:
- gajim/common/storage/archive.py
Changes:
=====================================
gajim/common/storage/archive.py
=====================================
@@ -1384,7 +1384,11 @@ def remove_history(self, account: str, jid: JID) -> None:
If it's a group chat, remove last MAM ID as well.
"""
account_id = self.get_account_id(account)
- jid_id = self.get_jid_id(jid)
+ try:
+ jid_id = self.get_jid_id(jid)
+ except ValueError:
+ log.info('No history entries for: %s', jid)
+ return
sql = 'DELETE FROM logs WHERE account_id = ? AND jid_id = ?'
self._con.execute(sql, (account_id, jid_id))
@@ -1392,7 +1396,11 @@ def remove_history(self, account: str, jid: JID) -> None:
log.info('Removed history for: %s', jid)
def forget_jid_data(self, account: str, jid: JID) -> None:
- jid_id = self.get_jid_id(jid)
+ try:
+ jid_id = self.get_jid_id(jid)
+ except ValueError:
+ log.info('No history entries for: %s', jid)
+ return
sql = 'DELETE FROM jids WHERE jid_id = ?'
self._con.execute(sql, (jid_id,))
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7a3a6822aa4459701e27571c923dbac6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7a3a6822aa4459701e27571c923dbac6…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
91ef7589 by wurstsalat at 2022-05-17T09:27:58+02:00
chore: Remove obsolete 'time_stamp' setting
- - - - -
1 changed file:
- gajim/common/setting_values.py
Changes:
=====================================
gajim/common/setting_values.py
=====================================
@@ -161,7 +161,6 @@ class _ACCOUNT_DEFAULT:
'show_main_window_on_startup',
'speller_language',
'stun_server',
- 'time_stamp',
'trayicon',
'video_framerate',
'video_input_device',
@@ -209,7 +208,6 @@ class _ACCOUNT_DEFAULT:
'hide_on_main_window_x_button': False,
'main_window_skip_taskbar': False,
'latest_disco_addresses': '',
- 'time_stamp': '%x | %X ',
'change_roster_title': True,
'restore_timeout': -1,
'send_on_ctrl_enter': False,
@@ -625,7 +623,6 @@ class WorkspaceSettings(TypedDict):
'ascii_formatting': _('Treat * / _ pairs as possible formatting characters.'),
'gc_refer_to_nick_char': _('Character to add after nickname when using nickname completion (tab) in group chat.'),
'save_main_window_position': _('If enabled, Gajim will save the main window position when hiding it, and restore it when showing the window again.'),
- 'time_stamp': _('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).'),
'chat_timestamp_format': 'https://docs.python.org/3/library/time.html#time.strftime',
'change_roster_title': _('If enabled, Gajim will add * and [n] in contact list window title.'),
'restore_timeout': _('How far back in time (minutes) chat history is restored. -1 means no limit.'),
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/91ef758993cab9c6332979fae55dd5b6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/91ef758993cab9c6332979fae55dd5b6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
7e6b655c by lovetox at 2022-05-17T00:00:27+02:00
fix: Chat: Handle race condition when calling focus()
focus() is called asynchron, this means self.msg_textview does
sometimes not exist anymore if shutdown() was called.
Fixes #10552
- - - - -
1 changed file:
- gajim/gtk/controls/chat.py
Changes:
=====================================
gajim/gtk/controls/chat.py
=====================================
@@ -267,6 +267,11 @@ def remove_actions(self) -> None:
app.window.remove_action(f'{action}{self.control_id}')
def focus(self) -> None:
+ if not hasattr(self, 'msg_textview'):
+ # focus() is called sometimes with GLib.idle_add()
+ # This means there is the possibility that shutdown() was called
+ # before focus is executed.
+ return
self.msg_textview.grab_focus()
def delegate_action(self, action: str) -> int:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7e6b655cbb07f96dd9bf77cf4da002b1…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7e6b655cbb07f96dd9bf77cf4da002b1…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
388490b8 by lovetox at 2022-05-16T22:35:08+02:00
fix: Bookmarks: Ignore bookmarks for roster contacts
Some clients allow to add MUCs as roster contacts, this creates
confusion when we receive them via bookmarks and assume they are a MUC.
Fixes #10781
- - - - -
1 changed file:
- gajim/common/modules/bookmarks.py
Changes:
=====================================
gajim/common/modules/bookmarks.py
=====================================
@@ -34,6 +34,7 @@
from gajim.common.events import BookmarksReceived
from gajim.common.types import BookmarksDict
from gajim.common.modules.base import BaseModule
+from gajim.common.modules.contacts import GroupchatContact
from gajim.common.modules.util import event_node
@@ -218,11 +219,24 @@ def _bookmarks_received(self, task: Task) -> None:
bookmarks = []
self._request_in_progress = False
+
+ self._cleanup_bookmarks(bookmarks)
self._bookmarks = self._convert_to_dict(bookmarks)
self.auto_join_bookmarks(self.bookmarks)
app.ged.raise_event(
BookmarksReceived(account=self._account))
+ def _cleanup_bookmarks(self, bookmarks: list[BookmarkData]) -> None:
+ for bookmark in list(bookmarks):
+ contact = self._client.get_module('Contacts').get_contact(
+ bookmark.jid, groupchat=True)
+ if not isinstance(contact, GroupchatContact):
+ # The contact exists probably in the roster and is therefore
+ # assumed to not be a MUC
+ self._log.warning('Received bookmark but jid is not '
+ 'a groupchat: %s', bookmark.jid)
+ bookmarks.remove(bookmark)
+
def store_bookmarks(self, bookmarks: List[BookmarkData]) -> None:
if not app.account_is_available(self._account):
return
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/388490b8f35d22169812bf35a5746c94…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/388490b8f35d22169812bf35a5746c94…
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:
e81b1dae by lovetox at 2022-05-16T18:17:51+02:00
fix: Roster: Raise exception if a full jid is found
- - - - -
1 changed file:
- nbxmpp/structs.py
Changes:
=====================================
nbxmpp/structs.py
=====================================
@@ -378,6 +378,9 @@ class RosterItem:
raise Exception('jid attribute missing')
jid = JID.from_string(jid)
+ if jid.is_full:
+ raise Exception('full jid in roster not allowed')
+
groups = {group.getData() for group in node.getTags('group')}
return cls(jid=jid,
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e81b1dae9f197ca3bc7ffee9…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e81b1dae9f197ca3bc7ffee9…
You're receiving this email because of your account on dev.gajim.org.