From e39f14dd1086b4214fccfec24f96799558ad73b5 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 5 Feb 2019 12:46:28 -0800 Subject: [PATCH 1/3] Implement Clear() on Bulletin --- qml/overlays/BulletinOverlay.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qml/overlays/BulletinOverlay.qml b/qml/overlays/BulletinOverlay.qml index e1e89e5..9ef59ab 100644 --- a/qml/overlays/BulletinOverlay.qml +++ b/qml/overlays/BulletinOverlay.qml @@ -57,7 +57,7 @@ ColumnLayout { target: gcd onClearMessages: function() { - //jsonModel4.clear() + jsonModel4.clear() } onAppendMessage: function(handle, from, displayName, message, image, mid, fromMe, ts) { From 401dcc958047f496c13a944c8a1410b8371dad2e Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 5 Feb 2019 13:09:38 -0800 Subject: [PATCH 2/3] Fixing Bulletin Reply --- go/gothings/gcd.go | 1 + go/gothings/uistate.go | 17 +++++++++++++++++ qml/overlays/BulletinOverlay.qml | 4 ---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/go/gothings/gcd.go b/go/gothings/gcd.go index 1481211..30d4a09 100644 --- a/go/gothings/gcd.go +++ b/go/gothings/gcd.go @@ -119,6 +119,7 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) { this.ClearMessages() this.SetCurrentOpenConversation(handle) c := this.UIState.GetContact(handle) + c.Badge = 0 this.UIState.UpdateContact(handle) diff --git a/go/gothings/uistate.go b/go/gothings/uistate.go index 52e6f6d..78c1e34 100644 --- a/go/gothings/uistate.go +++ b/go/gothings/uistate.go @@ -2,6 +2,7 @@ package gothings import ( "cwtch.im/ui/go/constants" + "cwtch.im/ui/go/cwutil" "cwtch.im/ui/go/gobjects" "cwtch.im/ui/go/the" "encoding/base32" @@ -50,6 +51,22 @@ func (this *InterfaceState) AddContact(c *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] } diff --git a/qml/overlays/BulletinOverlay.qml b/qml/overlays/BulletinOverlay.qml index 9ef59ab..06a37fc 100644 --- a/qml/overlays/BulletinOverlay.qml +++ b/qml/overlays/BulletinOverlay.qml @@ -173,10 +173,6 @@ ColumnLayout { } focus: true - onCurrentItemChanged: console.log(model.get(bulletinView.currentIndex).title + ' selected') - - - ListModel { id: jsonModel4 } From d4a601279c6721dce06e56e0675a63940d997dee Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 5 Feb 2019 13:48:24 -0800 Subject: [PATCH 3/3] Fixing no show text --- go/gothings/uistate.go | 11 +++-------- qml/overlays/ChatOverlay.qml | 4 ++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/go/gothings/uistate.go b/go/gothings/uistate.go index 78c1e34..547524f 100644 --- a/go/gothings/uistate.go +++ b/go/gothings/uistate.go @@ -74,21 +74,16 @@ func (this *InterfaceState) AddMessage(m *gobjects.Message) { _, found := this.contacts[m.Handle] if !found { this.AddContact(&gobjects.Contact{ - m.DisplayName, - m.Image, m.Handle, + m.Handle, + cwutil.RandomProfileImage(m.Handle), "", - 1, + 0, 0, false, }) } - c := the.Peer.GetContact(m.Handle) - if c == nil { - - } - _, found = this.messages[m.Handle] if !found { this.messages[m.Handle] = make([]*gobjects.Message, 0) diff --git a/qml/overlays/ChatOverlay.qml b/qml/overlays/ChatOverlay.qml index 3f813f4..24130e2 100644 --- a/qml/overlays/ChatOverlay.qml +++ b/qml/overlays/ChatOverlay.qml @@ -102,6 +102,9 @@ ColumnLayout { Flickable { id: flkMessage + anchors.fill: parent//this does nothing! bug in qt + Layout.minimumWidth: parent.width + Layout.maximumWidth: parent.width Layout.minimumHeight: rectMessage.height Layout.maximumHeight: rectMessage.height contentWidth: txtMessage.width @@ -120,6 +123,7 @@ ColumnLayout { padding: 6 wrapMode: TextEdit.Wrap textFormat: Text.RichText + width: rectMessage.width property bool skipOneUpdate: false