Fixing Bulletin Reply

This commit is contained in:
Sarah Jamie Lewis 2019-02-05 13:09:38 -08:00
parent 0e88349ae6
commit 401dcc9580
3 changed files with 18 additions and 4 deletions

View File

@ -119,6 +119,7 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
this.ClearMessages() this.ClearMessages()
this.SetCurrentOpenConversation(handle) this.SetCurrentOpenConversation(handle)
c := this.UIState.GetContact(handle) c := this.UIState.GetContact(handle)
c.Badge = 0 c.Badge = 0
this.UIState.UpdateContact(handle) this.UIState.UpdateContact(handle)

View File

@ -2,6 +2,7 @@ package gothings
import ( import (
"cwtch.im/ui/go/constants" "cwtch.im/ui/go/constants"
"cwtch.im/ui/go/cwutil"
"cwtch.im/ui/go/gobjects" "cwtch.im/ui/go/gobjects"
"cwtch.im/ui/go/the" "cwtch.im/ui/go/the"
"encoding/base32" "encoding/base32"
@ -50,6 +51,22 @@ func (this *InterfaceState) AddContact(c *gobjects.Contact) {
} }
func (this *InterfaceState) GetContact(handle string) *gobjects.Contact { func (this *InterfaceState) GetContact(handle string) *gobjects.Contact {
if _, found := this.contacts[handle]; !found {
c := &gobjects.Contact{
handle,
handle,
cwutil.RandomProfileImage(handle),
"",
1,
0,
false,
}
this.contacts[handle] = c
this.parentGcd.AddContact(c.Handle, c.DisplayName, c.Image, c.Server, c.Badge, c.Status, c.Trusted)
go the.Peer.PeerWithOnion(c.Handle)
}
return this.contacts[handle] return this.contacts[handle]
} }

View File

@ -173,10 +173,6 @@ ColumnLayout {
} }
focus: true focus: true
onCurrentItemChanged: console.log(model.get(bulletinView.currentIndex).title + ' selected')
ListModel { ListModel {
id: jsonModel4 id: jsonModel4
} }