From ae7e3e5c4e9e70be2ea8a445318c784651f28554 Mon Sep 17 00:00:00 2001 From: erinn Date: Wed, 28 Nov 2018 14:14:02 -0800 Subject: [PATCH] renaming bounce to cwtch.im/app --- go/characters/cwtchlistener.go | 4 +- go/characters/grouppoller.go | 4 +- go/characters/postmanpat.go | 4 +- go/characters/presencepoller.go | 8 ++-- go/characters/torstatuspoller.go | 57 +++++++++++++-------------- go/cwtchthings/chatchannellistener.go | 14 +++---- go/gobjects/contact.go | 2 +- go/gobjects/letter.go | 1 - go/gobjects/message.go | 2 +- go/gothings/gcd.go | 24 +++++------ go/gothings/uistate.go | 6 +-- go/the/globals.go | 4 +- main.go | 21 +++++----- 13 files changed, 73 insertions(+), 78 deletions(-) diff --git a/go/characters/cwtchlistener.go b/go/characters/cwtchlistener.go index 4320f41..e246f45 100644 --- a/go/characters/cwtchlistener.go +++ b/go/characters/cwtchlistener.go @@ -1,9 +1,9 @@ package characters import ( - "bounce/go/gobjects" - "bounce/go/the" "cwtch.im/cwtch/model" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" ) func CwtchListener(callback func(message *gobjects.Message), groupID string, channel chan model.Message) { diff --git a/go/characters/grouppoller.go b/go/characters/grouppoller.go index 4e1c7c6..1bc6a73 100644 --- a/go/characters/grouppoller.go +++ b/go/characters/grouppoller.go @@ -1,9 +1,9 @@ package characters import ( + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "time" - "bounce/go/the" - "bounce/go/gobjects" ) func GroupPoller(getContact func(string) *gobjects.Contact, updateContact func(string)) { diff --git a/go/characters/postmanpat.go b/go/characters/postmanpat.go index 643bb16..c149abd 100644 --- a/go/characters/postmanpat.go +++ b/go/characters/postmanpat.go @@ -1,10 +1,10 @@ package characters import ( - "bounce/go/the" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "git.openprivacy.ca/openprivacy/libricochet-go/channels" "log" - "bounce/go/gobjects" ) func PostmanPat(messages chan gobjects.Letter) { diff --git a/go/characters/presencepoller.go b/go/characters/presencepoller.go index 90cd70b..87d4f08 100644 --- a/go/characters/presencepoller.go +++ b/go/characters/presencepoller.go @@ -1,10 +1,10 @@ package characters import ( + "cwtch.im/ui/go/cwutil" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "time" - "bounce/go/the" - "bounce/go/cwutil" - "bounce/go/gobjects" ) func PresencePoller(getContact func(string) *gobjects.Contact, addContact func(contact *gobjects.Contact), updateContact func(string)) { // TODO: make this subscribe-able in ricochet @@ -46,4 +46,4 @@ func PresencePoller(getContact func(string) *gobjects.Contact, addContact func(c } time.Sleep(time.Second * 4) } -} \ No newline at end of file +} diff --git a/go/characters/torstatuspoller.go b/go/characters/torstatuspoller.go index a48e709..95c408f 100644 --- a/go/characters/torstatuspoller.go +++ b/go/characters/torstatuspoller.go @@ -1,35 +1,32 @@ package characters -import ( - "git.openprivacy.ca/openprivacy/asaur" - "strconv" - "time" -) - func TorStatusPoller(setTorStatus func(int, string)) { - for { - time.Sleep(time.Second) - //todo: this should use a config manager - //todo: also, try dialing the proxy to differentiate tor not running vs control port not configured - rawStatus, err := asaur.GetInfo("localhost:9051", "tcp4", "", "status/bootstrap-phase") - if err != nil { - setTorStatus(0, "can't find tor. is it running? is the controlport configured?") - continue + //TODO: convert this from asaur to bine + /* + for { + time.Sleep(time.Second) + //todo: this should use a config manager + //todo: also, try dialing the proxy to differentiate tor not running vs control port not configured + rawStatus, err := asaur.GetInfo("localhost:9051", "tcp4", "", "status/bootstrap-phase") + if err != nil { + setTorStatus(0, "can't find tor. is it running? is the controlport configured?") + continue + } + + status := asaur.ParseBootstrapPhase(rawStatus) + progress, _ := strconv.Atoi(status["PROGRESS"]) + + if status["TAG"] == "done" { + setTorStatus(3, "tor appears to be running just fine!") + continue + } + + if progress == 0 { + setTorStatus(1, "tor is trying to start up") + continue + } + + setTorStatus(2, status["SUMMARY"]) } - - status := asaur.ParseBootstrapPhase(rawStatus) - progress, _ := strconv.Atoi(status["PROGRESS"]) - - if status["TAG"] == "done" { - setTorStatus(3, "tor appears to be running just fine!") - continue - } - - if progress == 0 { - setTorStatus(1, "tor is trying to start up") - continue - } - - setTorStatus(2, status["SUMMARY"]) - } + */ } diff --git a/go/cwtchthings/chatchannellistener.go b/go/cwtchthings/chatchannellistener.go index 5e403af..a0924c9 100644 --- a/go/cwtchthings/chatchannellistener.go +++ b/go/cwtchthings/chatchannellistener.go @@ -1,18 +1,18 @@ package cwtchthings import ( + "cwtch.im/ui/go/cwutil" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "git.openprivacy.ca/openprivacy/libricochet-go/application" "git.openprivacy.ca/openprivacy/libricochet-go/channels" "time" - "bounce/go/the" - "bounce/go/cwutil" - "bounce/go/gobjects" ) type ChatChannelListener struct { - rai *application.ApplicationInstance - ra *application.RicochetApplication - addMessage func(*gobjects.Message) + rai *application.ApplicationInstance + ra *application.RicochetApplication + addMessage func(*gobjects.Message) acknowledged func(uint) } @@ -57,4 +57,4 @@ func (this *ChatChannelListener) ChatMessage(messageID uint32, when time.Time, m func (this *ChatChannelListener) ChatMessageAck(messageID uint32, accepted bool) { this.acknowledged(the.AcknowledgementIDs[messageID]) -} \ No newline at end of file +} diff --git a/go/gobjects/contact.go b/go/gobjects/contact.go index cdd235a..a86b583 100644 --- a/go/gobjects/contact.go +++ b/go/gobjects/contact.go @@ -8,4 +8,4 @@ type Contact struct { Badge int Status int Trusted bool -} \ No newline at end of file +} diff --git a/go/gobjects/letter.go b/go/gobjects/letter.go index 5b47fe7..aae65e7 100644 --- a/go/gobjects/letter.go +++ b/go/gobjects/letter.go @@ -5,4 +5,3 @@ type Letter struct { To, Message string MID uint } - diff --git a/go/gobjects/message.go b/go/gobjects/message.go index 7d5ebb5..8d4d779 100644 --- a/go/gobjects/message.go +++ b/go/gobjects/message.go @@ -11,4 +11,4 @@ type Message struct { FromMe bool MessageID int Timestamp time.Time -} \ No newline at end of file +} diff --git a/go/gothings/gcd.go b/go/gothings/gcd.go index 31dbc37..ae9b573 100644 --- a/go/gothings/gcd.go +++ b/go/gothings/gcd.go @@ -1,26 +1,26 @@ package gothings import ( - "bounce/go/constants" - "bounce/go/cwutil" + "cwtch.im/ui/go/constants" + "cwtch.im/ui/go/cwutil" + "cwtch.im/cwtch/model" + "cwtch.im/ui/go/characters" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "encoding/base32" "fmt" "github.com/therecipe/qt/core" "log" "strings" "time" - "bounce/go/the" - "cwtch.im/cwtch/model" - "bounce/go/characters" - "bounce/go/gobjects" ) type GrandCentralDispatcher struct { core.QObject OutgoingMessages chan gobjects.Letter - UIState InterfaceState + UIState InterfaceState _ string `property:"currentOpenConversation"` _ float32 `property:"themeScale"` @@ -31,16 +31,16 @@ type GrandCentralDispatcher struct { // messages pane stuff _ func(handle, from, displayName, message, image string, mID uint, fromMe bool, ts string) `signal:"AppendMessage"` - _ func() `signal:"ClearMessages"` - _ func() `signal:"ResetMessagePane"` - _ func(mID uint) `signal:"Acknowledged"` + _ func() `signal:"ClearMessages"` + _ func() `signal:"ResetMessagePane"` + _ func(mID uint) `signal:"Acknowledged"` // profile-area stuff _ func(name, onion, image string) `signal:"UpdateMyProfile"` _ func(status int, str string) `signal:"TorStatus"` // other stuff i can't ontologize atm - _ func(str string) `signal:"InvokePopup"` + _ func(str string) `signal:"InvokePopup"` _ func(name, server, invitation string) `signal:"SupplyGroupSettings"` // signals emitted from the ui (written in go, below) @@ -300,4 +300,4 @@ func (this *GrandCentralDispatcher) createGroup(server, groupName string) { the.Peer.JoinServer(server) group.NewMessage = make(chan model.Message) go characters.CwtchListener(this.UIState.AddMessage, group.GroupID, group.NewMessage) -} \ No newline at end of file +} diff --git a/go/gothings/uistate.go b/go/gothings/uistate.go index eafb531..1393174 100644 --- a/go/gothings/uistate.go +++ b/go/gothings/uistate.go @@ -1,10 +1,10 @@ package gothings import ( - "bounce/go/constants" - "bounce/go/gobjects" - "bounce/go/the" "cwtch.im/cwtch/model" + "cwtch.im/ui/go/constants" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/the" "encoding/base32" "log" "strings" diff --git a/go/the/globals.go b/go/the/globals.go index 6fc5e21..b6869e8 100644 --- a/go/the/globals.go +++ b/go/the/globals.go @@ -1,9 +1,9 @@ package the import ( - libPeer "cwtch.im/cwtch/peer" "cwtch.im/cwtch/app" - ) + libPeer "cwtch.im/cwtch/peer" +) var CwtchApp app.Application var Peer libPeer.CwtchPeer diff --git a/main.go b/main.go index 1600ed3..c565219 100644 --- a/main.go +++ b/main.go @@ -1,15 +1,19 @@ package main import ( - "bounce/go/characters" - "bounce/go/cwutil" - "bounce/go/the" libapp "cwtch.im/cwtch/app" "cwtch.im/cwtch/model" - "fmt" + "cwtch.im/ui/go/characters" + "cwtch.im/ui/go/cwtchthings" + "cwtch.im/ui/go/cwutil" + "cwtch.im/ui/go/gobjects" + "cwtch.im/ui/go/gothings" + "cwtch.im/ui/go/the" + "fmt" "git.openprivacy.ca/openprivacy/libricochet-go/application" "git.openprivacy.ca/openprivacy/libricochet-go/channels" - "github.com/therecipe/qt/core" + "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" + "github.com/therecipe/qt/core" "github.com/therecipe/qt/quick" "github.com/therecipe/qt/quickcontrols2" "github.com/therecipe/qt/widgets" @@ -17,10 +21,6 @@ import ( "os" "os/user" "path" - "bounce/go/cwtchthings" - "bounce/go/gothings" - "bounce/go/gobjects" - "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" ) func init() { @@ -145,7 +145,6 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) { the.Peer.SetApplicationInstanceFactory(aif) the.CwtchApp.LaunchPeers() - contacts := the.Peer.GetContacts() for i := range contacts { contact, _ := the.Peer.GetProfile().GetContact(contacts[i]) @@ -182,4 +181,4 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) { group.Accepted, }) } -} \ No newline at end of file +}