@@ -634,23 +634,28 @@ def test_unread_counts(self) -> None:
634634 # Check that the unread counter is back to 0.
635635 self ._check_unread_count (0 )
636636
637+ # Beeper: disabled unread for room name/topic changes
637638 # Check that room name changes increase the unread counter.
638- self .helper .send_state (
639- self .room_id ,
640- "m.room.name" ,
641- {"name" : "my super room" },
642- tok = self .tok2 ,
643- )
644- self ._check_unread_count (1 )
639+ # self.helper.send_state(
640+ # self.room_id,
641+ # "m.room.name",
642+ # {"name": "my super room"},
643+ # tok=self.tok2,
644+ # )
645+ # self._check_unread_count(1)
645646
646647 # Check that room topic changes increase the unread counter.
647- self .helper .send_state (
648- self .room_id ,
649- "m.room.topic" ,
650- {"topic" : "welcome!!!" },
651- tok = self .tok2 ,
652- )
653- self ._check_unread_count (2 )
648+ # self.helper.send_state(
649+ # self.room_id,
650+ # "m.room.topic",
651+ # {"topic": "welcome!!!"},
652+ # tok=self.tok2,
653+ # )
654+ # self._check_unread_count(2)
655+
656+ # Beeper: replacing the two events above
657+ self .helper .send_event (self .room_id , EventTypes .Encrypted , {}, tok = self .tok2 )
658+ self .helper .send_event (self .room_id , EventTypes .Encrypted , {}, tok = self .tok2 )
654659
655660 # Check that encrypted messages increase the unread counter.
656661 self .helper .send_event (self .room_id , EventTypes .Encrypted , {}, tok = self .tok2 )
@@ -664,6 +669,10 @@ def test_unread_counts(self) -> None:
664669 tok = self .tok2 ,
665670 )
666671 event_id = result ["event_id" ]
672+
673+ # Beeper: fake event to bump event count, we don't count custom events
674+ # as unread currently.
675+ self .helper .send_event (self .room_id , EventTypes .Encrypted , {}, tok = self .tok2 )
667676 self ._check_unread_count (4 )
668677
669678 # Check that edits don't increase the unread counter.
@@ -683,13 +692,14 @@ def test_unread_counts(self) -> None:
683692 self ._check_unread_count (4 )
684693
685694 # Check that notices don't increase the unread counter.
686- self .helper .send_event (
687- room_id = self .room_id ,
688- type = EventTypes .Message ,
689- content = {"body" : "hello" , "msgtype" : "m.notice" },
690- tok = self .tok2 ,
691- )
692- self ._check_unread_count (4 )
695+ # Beeper: notices count as unread
696+ # self.helper.send_event(
697+ # room_id=self.room_id,
698+ # type=EventTypes.Message,
699+ # content={"body": "hello", "msgtype": "m.notice"},
700+ # tok=self.tok2,
701+ # )
702+ # self._check_unread_count(4)
693703
694704 # Check that tombstone events changes increase the unread counter.
695705 res1 = self .helper .send_state (
@@ -698,7 +708,8 @@ def test_unread_counts(self) -> None:
698708 {"replacement_room" : "!someroom:test" },
699709 tok = self .tok2 ,
700710 )
701- self ._check_unread_count (5 )
711+ # Beeper: don't count tombston events as unread
712+ # self._check_unread_count(5)
702713 res2 = self .helper .send (self .room_id , "hello" , tok = self .tok2 )
703714
704715 # Make sure both m.read and org.matrix.msc2285.read.private advance
0 commit comments