From 6723bdf55805a8d8eb186fd2cd7612fd0500fce3 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 19 Nov 2021 11:50:37 -0800 Subject: [PATCH] GetMessagesByContentHash + Other API Fixes --- lib.go | 8 ++++---- utils/eventHandler.go | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib.go b/lib.go index f3d1d44..bfec80f 100644 --- a/lib.go +++ b/lib.go @@ -454,14 +454,14 @@ func LoadProfiles(pass string) { application.LoadProfiles(pass) } -//export c_AcceptConversations -func c_AcceptConversations(profilePtr *C.char, profileLen C.int, conversation_id C.int) { - AcceptConversations(C.GoStringN(profilePtr, profileLen), int(conversation_id)) +//export c_AcceptConversation +func c_AcceptConversation(profilePtr *C.char, profileLen C.int, conversation_id C.int) { + AcceptConversation(C.GoStringN(profilePtr, profileLen), int(conversation_id)) } // AcceptConversations takes in a profileOnion and a handle to either a group or a peer and authorizes the handle // for further action (e.g. messaging / connecting to the server / joining the group etc.) -func AcceptConversations(profileOnion string, conversation_id int) { +func AcceptConversation(profileOnion string, conversation_id int) { profile := application.GetPeer(profileOnion) profile.AcceptConversation(int(conversation_id)) } diff --git a/utils/eventHandler.go b/utils/eventHandler.go index da6a4ef..aa7ecb3 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -151,9 +151,9 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { continue } - name, exists := conversationInfo.GetAttribute(attr.LocalScope, attr.ProfileZone, constants.Name) + name, exists := conversationInfo.GetAttribute(attr.PublicScope, attr.ProfileZone, constants.Name) if !exists { - name, exists = conversationInfo.GetAttribute(attr.PeerScope, attr.ProfileZone, constants.Name) + name, exists = conversationInfo.GetAttribute(attr.LocalScope, attr.ProfileZone, constants.Name) if !exists { name = conversationInfo.Handle } @@ -351,6 +351,7 @@ func (eh *EventHandler) startHandlingPeer(onion string) { eventBus.Subscribe(event.AppError, q) eventBus.Subscribe(event.IndexedAcknowledgement, q) eventBus.Subscribe(event.IndexedFailure, q) + eventBus.Subscribe(event.ContactCreated, q) eventBus.Subscribe(event.NewMessageFromGroup, q) eventBus.Subscribe(event.MessageCounterResync, q) eventBus.Subscribe(event.GroupCreated, q)