Philipp Hörist pushed to branch archive_cache at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/common/modules/contacts.py
    ... ... @@ -15,14 +15,11 @@
    15 15
     from __future__ import annotations
    
    16 16
     
    
    17 17
     from typing import Any
    
    18
    -from typing import cast
    
    19 18
     from typing import Iterator
    
    20 19
     from typing import Optional
    
    21 20
     from typing import Union
    
    22 21
     from typing import overload
    
    23 22
     
    
    24
    -import time
    
    25
    -
    
    26 23
     import cairo
    
    27 24
     from nbxmpp.const import Affiliation
    
    28 25
     from nbxmpp.const import Chatstate
    
    ... ... @@ -32,12 +29,9 @@
    32 29
     from nbxmpp.structs import DiscoInfo
    
    33 30
     from nbxmpp.structs import LocationData
    
    34 31
     from nbxmpp.structs import TuneData
    
    35
    -from nbxmpp.structs import MessageProperties
    
    36 32
     from nbxmpp.structs import MucSubject
    
    37
    -from nbxmpp.structs import PresenceProperties
    
    38 33
     
    
    39 34
     from gajim.common import app
    
    40
    -from gajim.common import events
    
    41 35
     from gajim.common import types
    
    42 36
     from gajim.common.const import PresenceShowExt
    
    43 37
     from gajim.common.const import SimpleClientState
    

  • gajim/common/modules/muc.py
    ... ... @@ -696,10 +696,12 @@ def _process_occupant_presence_change(
    696 696
                     status_codes=properties.muc_status_codes)
    
    697 697
     
    
    698 698
                 occupant.update_presence(presence)
    
    699
    -            occupant.notify('user-joined', properties)
    
    699
    +            app.storage.events.store(self.room, event)
    
    700
    +            occupant.notify('user-joined', event)
    
    700 701
                 return
    
    701 702
     
    
    702 703
             if not presence.available:
    
    704
    +
    
    703 705
                 event = events.MUCUserLeft(
    
    704 706
                     timestamp=timestamp,
    
    705 707
                     is_self=properties.is_muc_self_presence,
    
    ... ... @@ -709,12 +711,14 @@ def _process_occupant_presence_change(
    709 711
                     actor=properties.muc_user.actor)
    
    710 712
     
    
    711 713
                 occupant.update_presence(presence)
    
    712
    -            occupant.notify('user-left', properties)
    
    714
    +            app.storage.events.store(self.room, event)
    
    715
    +            occupant.notify('user-left', event)
    
    713 716
                 return
    
    714 717
     
    
    715 718
             signals_and_events: list[tuple[str, Any]] = []
    
    716 719
     
    
    717 720
             if occupant.affiliation != presence.affiliation:
    
    721
    +
    
    718 722
                 event = events.MUCUserAffiliationChanged(
    
    719 723
                     timestamp=timestamp,
    
    720 724
                     is_self=properties.is_muc_self_presence,
    
    ... ... @@ -726,6 +730,7 @@ def _process_occupant_presence_change(
    726 730
                 signals_and_events.append(('user-affiliation-changed', event))
    
    727 731
     
    
    728 732
             if occupant.role != presence.role:
    
    733
    +
    
    729 734
                 event = events.MUCUserRoleChanged(
    
    730 735
                     timestamp=timestamp,
    
    731 736
                     is_self=properties.is_muc_self_presence,
    
    ... ... @@ -751,7 +756,7 @@ def _process_occupant_presence_change(
    751 756
             occupant.update_presence(presence)
    
    752 757
             for signal, event in signals_and_events:
    
    753 758
                 app.storage.events.store(self.room, event)
    
    754
    -            occupant.notify(signal, properties)
    
    759
    +            occupant.notify(signal, event)
    
    755 760
     
    
    756 761
         def _process_user_presence(self,
    
    757 762
                                    properties: PresenceProperties