Philipp Hörist pushed to branch archive_cache at gajim / gajim
Commits: 21eb4b05 by lovetox at 2022-09-04T12:43:11+02:00 cfix: fix contacts
- - - - - 0a0b70cf by lovetox at 2022-09-04T12:59:21+02:00 cfix: fix some things
- - - - -
2 changed files:
- gajim/common/modules/contacts.py - gajim/common/modules/muc.py
Changes:
===================================== gajim/common/modules/contacts.py ===================================== @@ -15,14 +15,11 @@ from __future__ import annotations
from typing import Any -from typing import cast from typing import Iterator from typing import Optional from typing import Union from typing import overload
-import time - import cairo from nbxmpp.const import Affiliation from nbxmpp.const import Chatstate @@ -32,12 +29,9 @@ from nbxmpp.structs import DiscoInfo from nbxmpp.structs import LocationData from nbxmpp.structs import TuneData -from nbxmpp.structs import MessageProperties from nbxmpp.structs import MucSubject -from nbxmpp.structs import PresenceProperties
from gajim.common import app -from gajim.common import events from gajim.common import types from gajim.common.const import PresenceShowExt from gajim.common.const import SimpleClientState
===================================== gajim/common/modules/muc.py ===================================== @@ -696,10 +696,12 @@ def _process_occupant_presence_change( status_codes=properties.muc_status_codes)
occupant.update_presence(presence) - occupant.notify('user-joined', properties) + app.storage.events.store(self.room, event) + occupant.notify('user-joined', event) return
if not presence.available: + event = events.MUCUserLeft( timestamp=timestamp, is_self=properties.is_muc_self_presence, @@ -709,12 +711,14 @@ def _process_occupant_presence_change( actor=properties.muc_user.actor)
occupant.update_presence(presence) - occupant.notify('user-left', properties) + app.storage.events.store(self.room, event) + occupant.notify('user-left', event) return
signals_and_events: list[tuple[str, Any]] = []
if occupant.affiliation != presence.affiliation: + event = events.MUCUserAffiliationChanged( timestamp=timestamp, is_self=properties.is_muc_self_presence, @@ -726,6 +730,7 @@ def _process_occupant_presence_change( signals_and_events.append(('user-affiliation-changed', event))
if occupant.role != presence.role: + event = events.MUCUserRoleChanged( timestamp=timestamp, is_self=properties.is_muc_self_presence, @@ -751,7 +756,7 @@ def _process_occupant_presence_change( occupant.update_presence(presence) for signal, event in signals_and_events: app.storage.events.store(self.room, event) - occupant.notify(signal, properties) + occupant.notify(signal, event)
def _process_user_presence(self, properties: PresenceProperties
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/b020fd3cdeb01ab8c42e1445b78a0ad0...