fix: group moderation and profile sync

This commit is contained in:
richjohnrambo
2026-10-17 10:12:20 +08:00
parent ea29fef40f
commit 9132207e21
9 changed files with 126 additions and 19 deletions
+11
View File
@@ -11,6 +11,17 @@ import (
"github.com/tinode/chat/server/store/types"
)
func TestGroupMemberProfileEventIsVisibleToAllMembers(t *testing.T) {
const event = "group.member.profile.updated"
if isAdminOnlyIMGroupEvent(event) {
t.Fatal("group nickname update must reach ordinary members")
}
payload := enrichIMGroupMemberEventPayload(event, map[string]any{"user_id": "usrMember"}).(map[string]any)
if payload["member_sync"] != "single" || payload["visibility"] != "all_members" {
t.Fatalf("unexpected group profile event payload: %#v", payload)
}
}
func TestPublishIMGroupRealtimeEventRestrictsMemberRemoval(t *testing.T) {
oldGroupBusiness := store.GroupBusiness
oldSessions := globals.sessionStore