Browse Source

renaming bounce to cwtch.im/app

erinn 4 months ago
parent
commit
ae7e3e5c4e

+ 2 - 2
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) {

+ 2 - 2
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)) {

+ 2 - 2
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) {

+ 4 - 4
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)
 	}
-}
+}

+ 24 - 27
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"])
+			status := asaur.ParseBootstrapPhase(rawStatus)
+			progress, _ := strconv.Atoi(status["PROGRESS"])
 
-		if status["TAG"] == "done" {
-			setTorStatus(3, "tor appears to be running just fine!")
-			continue
-		}
+			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
-		}
+			if progress == 0 {
+				setTorStatus(1, "tor is trying to start up")
+				continue
+			}
 
-		setTorStatus(2, status["SUMMARY"])
-	}
+			setTorStatus(2, status["SUMMARY"])
+		}
+	*/
 }

+ 7 - 7
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])
-}
+}

+ 1 - 1
go/gobjects/contact.go

@@ -8,4 +8,4 @@ type Contact struct {
 	Badge       int
 	Status      int
 	Trusted     bool
-}
+}

+ 0 - 1
go/gobjects/letter.go

@@ -5,4 +5,3 @@ type Letter struct {
 	To, Message string
 	MID         uint
 }
-

+ 1 - 1
go/gobjects/message.go

@@ -11,4 +11,4 @@ type Message struct {
 	FromMe      bool
 	MessageID   int
 	Timestamp   time.Time
-}
+}

+ 12 - 12
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)
-}
+}

+ 3 - 3
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"

+ 2 - 2
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

+ 10 - 11
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,
 		})
 	}
-}
+}