This commit is contained in:
Sarah Jamie Lewis 2019-07-31 15:35:35 -07:00
parent d13c53cc73
commit 10f892d10d
6 changed files with 30 additions and 33 deletions

View File

@ -76,7 +76,6 @@ func AppEventListener(gcd *gothings.GrandCentralDispatcher, subscribed chan bool
gcd.UpdateMyProfile(the.Peer.GetProfile().Name, the.Peer.GetProfile().Onion, cwutil.RandomProfileImage(the.Peer.GetProfile().Onion))
contacts := the.Peer.GetContacts()
for i := range contacts {
contact, _ := the.Peer.GetProfile().GetContact(contacts[i])

View File

@ -85,13 +85,13 @@ func IncomingListener(uiState *gothings.InterfaceState, subscribed chan bool) {
case event.PeerStateChange:
cxnState := connections.ConnectionStateToType[e.Data[event.ConnectionState]]
_,exists := the.Peer.GetProfile().Contacts[e.Data[event.RemotePeer]]
_, exists := the.Peer.GetProfile().Contacts[e.Data[event.RemotePeer]]
if !exists {
// Contact does not exist, we will add them but we won't know who they are until they are authenticated
// So if we get any other state from an unknown contact we do nothing
// (the next exists check will fail)
if cxnState == connections.AUTHENTICATED {
the.Peer.AddContact(e.Data[event.RemotePeer],e.Data[event.RemotePeer],false)
the.Peer.AddContact(e.Data[event.RemotePeer], e.Data[event.RemotePeer], false)
}
}

View File

@ -237,7 +237,7 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
from = "me"
}
ackI,ok := the.AcknowledgementIDs.Load(messages[i].MessageID)
ackI, ok := the.AcknowledgementIDs.Load(messages[i].MessageID)
acked := false
if ok {
ack := ackI.(*the.AckId)

View File

@ -103,7 +103,7 @@ func (this *InterfaceState) GetContact(handle string) *gobjects.Contact {
}
func (this *InterfaceState) AddSendMessageError(peer string, signature string, err string) {
ackI,ok := the.AcknowledgementIDs.Load(signature)
ackI, ok := the.AcknowledgementIDs.Load(signature)
if ok {
ack := ackI.(*the.AckId)
ack.Error = true
@ -134,7 +134,6 @@ func (this *InterfaceState) AddMessage(m *gobjects.Message) {
// Ack message sent to group
this.parentGcd.Acknowledged(m.MessageID)
messages, _ := this.messages.Load(m.Handle)
messageList, _ := messages.([]*gobjects.Message)
this.messages.Store(m.Handle, append(messageList, m))
@ -155,7 +154,6 @@ func (this *InterfaceState) AddMessage(m *gobjects.Message) {
}
}
}
func (this *InterfaceState) GetMessages(handle string) []*gobjects.Message {