feat: Dispatch profile showcase message on mutual/verified contacts change (#4678)
This commit is contained in:
parent
005e7e6ee4
commit
2350461818
|
@ -451,6 +451,12 @@ func (m *Messenger) VerifiedTrusted(ctx context.Context, request *requests.Verif
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Dispatch profile message to save a contact to the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &MessengerResponse{}
|
||||
|
||||
notification.ContactVerificationStatus = verification.RequestStatusTRUSTED
|
||||
|
@ -558,6 +564,12 @@ func (m *Messenger) VerifiedUntrustworthy(ctx context.Context, request *requests
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Dispatch profile message to remove a contact from the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &MessengerResponse{}
|
||||
|
||||
notification.ContactVerificationStatus = verification.RequestStatusUNTRUSTWORTHY
|
||||
|
@ -713,6 +725,12 @@ func (m *Messenger) RemoveTrustStatus(ctx context.Context, contactID string) err
|
|||
return err
|
||||
}
|
||||
|
||||
// Dispatch profile message to remove a contact from the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return m.SyncTrustedUser(ctx, contactID, verification.TrustStatusUNKNOWN, m.dispatchMessage)
|
||||
}
|
||||
|
||||
|
|
|
@ -303,6 +303,12 @@ func (m *Messenger) updateAcceptedContactRequest(response *MessengerResponse, co
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Dispatch profile message to add a contact to the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if response == nil {
|
||||
|
@ -682,6 +688,12 @@ func (m *Messenger) removeContact(ctx context.Context, response *MessengerRespon
|
|||
return err
|
||||
}
|
||||
|
||||
// Dispatch profile message to remove a contact from the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Profile chats are deprecated.
|
||||
// Code below can be removed after some reasonable time.
|
||||
|
||||
|
|
|
@ -1038,6 +1038,12 @@ func (m *Messenger) handleAcceptContactRequestMessage(state *ReceivedMessageStat
|
|||
return err
|
||||
}
|
||||
chat.UnviewedMessagesCount++
|
||||
|
||||
// Dispatch profile message to add a contact to the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
state.Response.AddChat(chat)
|
||||
|
@ -1110,6 +1116,12 @@ func (m *Messenger) handleRetractContactRequest(state *ReceivedMessageState, con
|
|||
return err
|
||||
}
|
||||
|
||||
// Dispatch profile message to remove a contact from the encrypted profile part
|
||||
err = m.DispatchProfileShowcase()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = m.prepareMessage(updateMessage, m.httpServer)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue