diff --git a/.drone.yml b/.drone.yml index f5ef61d..cc42ec2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,8 +10,10 @@ pipeline: - QT_DIR=/opt/Qt - QT_DOCKER='true' - QT_API=5.12.0 - - GOPATH=/home/user/work:/media/sf_GOPATH1/ commands: + - echo $QT_DIR + - export GOPATH=$GOPATH:/media/sf_GOPATH1/ + - echo $GOPATH - export PATH=$PATH:/home/user/work/bin:/media/sf_GOPATH1/bin - echo $PATH - apt-get -qq update && apt-get --no-install-recommends -qq -y install ca-certificates curl git diff --git a/README.md b/README.md index 75e52c2..8ca56d8 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,4 @@ We supply an arm-pie version of tor in `android/libs/armeabi-v7a` with the name If all that is done, then check out cwtch.im/ui and run `qtdeploy` in the root of it. -Currently you will need to manually run tor first before running cwtch.im/ui - - [https://www.torproject.org/download/download](Tor download) - Get the "Expert Bundle" which just has tor - - create a `torrc` file with the following: - -``` -SOCKSPort 9050 -ControlPort 9051 -CookieAuthentication 0 -``` - - - and tun tor with `tor -f torrc` +Currently you will need to manually run tor first before running cwtch.im/ui. Use the included tor and torrc file: `tor -f torrc` diff --git a/go/characters/incominglistener.go b/go/characters/incominglistener.go index 266c5ea..a2c0aa5 100644 --- a/go/characters/incominglistener.go +++ b/go/characters/incominglistener.go @@ -40,6 +40,18 @@ func IncomingListener(callback func(*gobjects.Message), groupErrorCallback func( the.Peer.SendMessageToPeer(e.Data[event.RemotePeer], "ack") } case event.NewMessageFromGroup://event.TimestampReceived, event.TimestampSent, event.Data, event.GroupID, event.RemotePeer + var name string + var exists bool + ctc := the.Peer.GetContact(e.Data[event.RemotePeer]) + if ctc != nil { + name, exists = ctc.GetAttribute("nick") + if !exists || name == "" { + name = e.Data[event.RemotePeer] + "..." + } + } else { + name = e.Data[event.RemotePeer] + "..." + } + ts, _ := time.Parse(time.RFC3339Nano, e.Data[event.TimestampSent]) callback(&gobjects.Message{ MessageID: e.Data[event.Signature], @@ -50,6 +62,7 @@ func IncomingListener(callback func(*gobjects.Message), groupErrorCallback func( FromMe: e.Data[event.RemotePeer] == the.Peer.GetProfile().Onion, Timestamp: ts, Acknowledged: true, + DisplayName: name, }) case event.NewGroupInvite: log.Debugf("got a group invite!") diff --git a/qml/widgets/MyProfile.qml b/qml/widgets/MyProfile.qml index b227e92..5b2b1dd 100644 --- a/qml/widgets/MyProfile.qml +++ b/qml/widgets/MyProfile.qml @@ -5,6 +5,9 @@ import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import QtQuick.Window 2.11 +import QtQuick.Controls 1.4 + +import "../styles" ColumnLayout { id: root @@ -200,49 +203,19 @@ ColumnLayout { } } - RowLayout { - anchors.left: parent.left - anchors.right: parent.right + TextField { + anchors.horizontalCenter: parent.horizontalCenter + style: CwtchTextFieldStyle{ width: 400 } + placeholderText: "... paste an address here to add a contact ..." + horizontalAlignment: TextInput.AlignHCenter - - Rectangle { // ADD CONTACTS TEXTFIELD - width: parent.width - 4 - height: 20 - color: "#EDEDED" - border.color: "#AAAAAA" - border.width: 1 - radius: 10 - anchors.horizontalCenter: parent.horizontalCenter - - - TextEdit { - property string hint: "... paste an address here to add a contact ..." - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - font.pixelSize: 9 - color: "#888888" - padding: 2 - text: hint - selectByMouse: true - - onTextChanged: { - if (text != hint && text != "") { - console.log("to handle: "+text) - gcd.importString(text) - text = hint - } - } - - onFocusChanged: { - text = focus ? "" : hint - } - - onCursorPositionChanged: { - text = focus ? "" : hint - } - } - } - } + onTextChanged: { + if (text != "") { + gcd.importString(text) + text = "" + } + } + } Connections { target: gcd