fix: group moderation and profile sync
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user