From c3189553c8b353adfa0bee2f1b7da0b589d4aec6 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 24 Sep 2019 11:47:27 -0700 Subject: [PATCH] BUGFIX: Prevent the user from opening a conversation with themselves --- go.mod | 3 +-- go.sum | 4 ++-- go/gothings/gcd.go | 3 +++ qml/widgets/ContactRow.qml | 14 ++++++++------ 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 81fcecab..c963c578 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,8 @@ module cwtch.im/ui go 1.12 require ( - cwtch.im/cwtch v0.2.1-pr-1 + cwtch.im/cwtch v0.3.0 git.openprivacy.ca/openprivacy/libricochet-go v1.0.6 - github.com/golang/protobuf v1.3.2 github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect github.com/kr/pretty v0.1.0 // indirect github.com/stretchr/testify v1.4.0 // indirect diff --git a/go.sum b/go.sum index 0afc0332..f9263af6 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -cwtch.im/cwtch v0.2.1-pr-1 h1:yC9aP9OnE6mUtLbZ5JNJjGMZGA3OWq6Vd+e5j8rihMg= -cwtch.im/cwtch v0.2.1-pr-1/go.mod h1:8tmtp3c7fccWw9H7s9u6E8GD2PKI3ar21i0fjN8pzd0= +cwtch.im/cwtch v0.3.0 h1:RFZyc2m9BowFNdngBs7GcQE41w75jMp3Ku5zEE92v9I= +cwtch.im/cwtch v0.3.0/go.mod h1:8tmtp3c7fccWw9H7s9u6E8GD2PKI3ar21i0fjN8pzd0= cwtch.im/tapir v0.1.10 h1:V+TkmwXNd6gySZqlVw468wMYEkmDwMSyvhkkpOfUw7w= cwtch.im/tapir v0.1.10/go.mod h1:EuRYdVrwijeaGBQ4OijDDRHf7R2MDSypqHkSl5DxI34= git.openprivacy.ca/openprivacy/libricochet-go v1.0.4/go.mod h1:yMSG1gBaP4f1U+RMZXN85d29D39OK5s8aTpyVRoH5FY= diff --git a/go/gothings/gcd.go b/go/gothings/gcd.go index b9f5b169..d9e8f2e4 100644 --- a/go/gothings/gcd.go +++ b/go/gothings/gcd.go @@ -162,6 +162,9 @@ func (this *GrandCentralDispatcher) loadMessagesPane(handle string) { } func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) { + if handle == the.Peer.GetProfile().Onion { + return + } this.ClearMessages() this.SetCurrentOpenConversation(handle) c := this.UIState.GetContact(handle) diff --git a/qml/widgets/ContactRow.qml b/qml/widgets/ContactRow.qml index 55b65c08..3b4f2661 100644 --- a/qml/widgets/ContactRow.qml +++ b/qml/widgets/ContactRow.qml @@ -118,12 +118,14 @@ Item { // LOTS OF NESTING TO DEAL WITH QT WEIRDNESS, SORRY hoverEnabled: true onClicked: { - gcd.broadcast("ResetMessagePane") - isActive = true - theStack.pane = theStack.messagePane - gcd.loadMessagesPane(handle) - if (handle.length == 32) { - gcd.requestGroupSettings(handle) + if (displayName != "me") { + gcd.broadcast("ResetMessagePane") + isActive = true + theStack.pane = theStack.messagePane + gcd.loadMessagesPane(handle) + if (handle.length == 32) { + gcd.requestGroupSettings(handle) + } } }