Add support for "enhanced" sendinvite
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2023-03-02 10:51:44 -08:00
parent 456afb0262
commit 0ea5cbba31
2 changed files with 14 additions and 0 deletions

View File

@ -75,6 +75,16 @@ type cwtchPeer struct {
experimentsLock sync.Mutex experimentsLock sync.Mutex
} }
// EnhancedSendInviteMessage encapsulates attempting to send an invite to a conversation and looking up the enhanced message
// useful for UIs.
func (cp *cwtchPeer) EnhancedSendInviteMessage(conversation int, inviteConversationID int) string {
mid, err := cp.SendInviteToConversation(conversation, inviteConversationID)
if err == nil {
return cp.EnhancedGetMessageById(conversation, mid)
}
return ""
}
func (cp *cwtchPeer) EnhancedImportBundle(importString string) string { func (cp *cwtchPeer) EnhancedImportBundle(importString string) string {
return cp.ImportBundle(importString).Error() return cp.ImportBundle(importString).Error()
} }

View File

@ -53,6 +53,10 @@ type SendMessages interface {
EnhancedSendMessage(conversation int, message string) string EnhancedSendMessage(conversation int, message string) string
SendInviteToConversation(conversationID int, inviteConversationID int) (int, error) SendInviteToConversation(conversationID int, inviteConversationID int) (int, error)
// EnhancedSendInviteMessage Attempts to Send an Invite and Immediately Attempts to Lookup the Message in the Database
EnhancedSendInviteMessage(conversation int, inviteConversationID int) string
SendScopedZonedGetValToContact(conversationID int, scope attr.Scope, zone attr.Zone, key string) SendScopedZonedGetValToContact(conversationID int, scope attr.Scope, zone attr.Zone, key string)
} }