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
|
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{}
|
response := &MessengerResponse{}
|
||||||
|
|
||||||
notification.ContactVerificationStatus = verification.RequestStatusTRUSTED
|
notification.ContactVerificationStatus = verification.RequestStatusTRUSTED
|
||||||
|
@ -558,6 +564,12 @@ func (m *Messenger) VerifiedUntrustworthy(ctx context.Context, request *requests
|
||||||
return nil, err
|
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{}
|
response := &MessengerResponse{}
|
||||||
|
|
||||||
notification.ContactVerificationStatus = verification.RequestStatusUNTRUSTWORTHY
|
notification.ContactVerificationStatus = verification.RequestStatusUNTRUSTWORTHY
|
||||||
|
@ -713,6 +725,12 @@ func (m *Messenger) RemoveTrustStatus(ctx context.Context, contactID string) err
|
||||||
return 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)
|
return m.SyncTrustedUser(ctx, contactID, verification.TrustStatusUNKNOWN, m.dispatchMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,12 @@ func (m *Messenger) updateAcceptedContactRequest(response *MessengerResponse, co
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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 {
|
if response == nil {
|
||||||
|
@ -682,6 +688,12 @@ func (m *Messenger) removeContact(ctx context.Context, response *MessengerRespon
|
||||||
return err
|
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.
|
// Profile chats are deprecated.
|
||||||
// Code below can be removed after some reasonable time.
|
// Code below can be removed after some reasonable time.
|
||||||
|
|
||||||
|
|
|
@ -1038,6 +1038,12 @@ func (m *Messenger) handleAcceptContactRequestMessage(state *ReceivedMessageStat
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
chat.UnviewedMessagesCount++
|
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)
|
state.Response.AddChat(chat)
|
||||||
|
@ -1110,6 +1116,12 @@ func (m *Messenger) handleRetractContactRequest(state *ReceivedMessageState, con
|
||||||
return err
|
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)
|
err = m.prepareMessage(updateMessage, m.httpServer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue