Add support for "enhanced" sendinvite #500

Merged
sarah merged 1 commits from esi into master 2023-03-02 20:43:20 +00:00
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)
} }