Philipp Hörist pushed to branch unify-control at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/gtk/control.py
    ... ... @@ -256,25 +256,17 @@ def _on_message_moderated(self, event: events.MessageModerated) -> None:
    256 256
             self.conversation_view.show_message_retraction(
    
    257 257
                 event.moderation.stanza_id, text)
    
    258 258
     
    
    259
    -    @property
    
    260
    -    def type(self) -> ControlType:
    
    261
    -        assert self._type is not None
    
    262
    -        return self._type
    
    263
    -
    
    264 259
         @property
    
    265 260
         def is_chat(self) -> bool:
    
    266
    -        assert self._type is not None
    
    267
    -        return self._type.is_chat
    
    261
    +        return isinstance(self.contact, BareContact)
    
    268 262
     
    
    269 263
         @property
    
    270 264
         def is_privatechat(self) -> bool:
    
    271
    -        assert self._type is not None
    
    272
    -        return self._type.is_privatechat
    
    265
    +        return isinstance(self.contact, GroupchatParticipant)
    
    273 266
     
    
    274 267
         @property
    
    275 268
         def is_groupchat(self) -> bool:
    
    276
    -        assert self._type is not None
    
    277
    -        return self._type.is_groupchat
    
    269
    +        return isinstance(self.contact, GroupchatContact)
    
    278 270
     
    
    279 271
         def _on_ping_event(self, event: events.PingEventT) -> None:
    
    280 272
             raise NotImplementedError
    
    ... ... @@ -769,7 +761,7 @@ def _on_user_status_show_changed(self,
    769 761
                                          ) -> None:
    
    770 762
     
    
    771 763
             # TODO: This cant work
    
    772
    -
    
    764
    +        return
    
    773 765
             if isinstance(self.contact, GroupchatContact):
    
    774 766
                 if not contact.settings.get('print_status'):
    
    775 767
                     return