Don't send new members event when there are no new members
This commit is contained in:
parent
d04e54e54e
commit
9dffff042e
|
@ -723,18 +723,22 @@ func (m *Messenger) CreateGroupChatWithMembers(ctx context.Context, name string,
|
||||||
chat.updateChatFromGroupMembershipChanges(contactIDFromPublicKey(&m.identity.PublicKey), group)
|
chat.updateChatFromGroupMembershipChanges(contactIDFromPublicKey(&m.identity.PublicKey), group)
|
||||||
|
|
||||||
clock, _ = chat.NextClockAndTimestamp(m.getTimesource())
|
clock, _ = chat.NextClockAndTimestamp(m.getTimesource())
|
||||||
|
|
||||||
// Add members
|
// Add members
|
||||||
event := v1protocol.NewMembersAddedEvent(members, clock)
|
if len(members) > 0 {
|
||||||
event.ChatID = chat.ID
|
event := v1protocol.NewMembersAddedEvent(members, clock)
|
||||||
err = event.Sign(m.identity)
|
event.ChatID = chat.ID
|
||||||
if err != nil {
|
err = event.Sign(m.identity)
|
||||||
return nil, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = group.ProcessEvent(event)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = group.ProcessEvent(event)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
recipients, err := stringSliceToPublicKeys(group.Members(), true)
|
recipients, err := stringSliceToPublicKeys(group.Members(), true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue