forked from cwtch.im/ui
who knows what this change is. git is terrible
This commit is contained in:
parent
23d0b36e83
commit
bac22f7551
|
@ -1,32 +1,28 @@
|
||||||
package characters
|
package characters
|
||||||
|
|
||||||
func TorStatusPoller(setTorStatus func(int, string)) {
|
import (
|
||||||
//TODO: convert this from asaur to bine
|
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
||||||
/*
|
"time"
|
||||||
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)
|
func TorStatusPoller(setTorStatus func(int, string), acn connectivity.ACN) {
|
||||||
progress, _ := strconv.Atoi(status["PROGRESS"])
|
for {
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
if status["TAG"] == "done" {
|
percent, message := acn.GetBootstrapStatus()
|
||||||
setTorStatus(3, "tor appears to be running just fine!")
|
var statuscode int
|
||||||
continue
|
if percent == 0 {
|
||||||
}
|
statuscode = 0
|
||||||
|
message = "can't find tor. is it running? is the controlport configured?"
|
||||||
if progress == 0 {
|
} else if percent == 100 {
|
||||||
setTorStatus(1, "tor is trying to start up")
|
statuscode = 3
|
||||||
continue
|
message = "tor appears to be running just fine!"
|
||||||
}
|
} else if percent < 80 {
|
||||||
|
statuscode = 1
|
||||||
setTorStatus(2, status["SUMMARY"])
|
} else {
|
||||||
|
statuscode = 2
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
setTorStatus(statuscode, message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -66,7 +66,7 @@ func main() {
|
||||||
loadCwtchData(gcd, acn)
|
loadCwtchData(gcd, acn)
|
||||||
go characters.IncomingListener(gcd.UIState.AddMessage)
|
go characters.IncomingListener(gcd.UIState.AddMessage)
|
||||||
go characters.PostmanPat(gcd.OutgoingMessages)
|
go characters.PostmanPat(gcd.OutgoingMessages)
|
||||||
go characters.TorStatusPoller(gcd.TorStatus)
|
go characters.TorStatusPoller(gcd.TorStatus, acn)
|
||||||
go characters.PresencePoller(gcd.UIState.GetContact, gcd.UIState.AddContact, gcd.UIState.UpdateContact)
|
go characters.PresencePoller(gcd.UIState.GetContact, gcd.UIState.AddContact, gcd.UIState.UpdateContact)
|
||||||
go characters.GroupPoller(gcd.UIState.GetContact, gcd.UIState.UpdateContact)
|
go characters.GroupPoller(gcd.UIState.GetContact, gcd.UIState.UpdateContact)
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,20 @@ ColumnLayout { // groupSettingsPane
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ScalingLabel { text: "Invite someone to the group:" }
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
id: cbInvite
|
||||||
|
popup.font.pixelSize: 12
|
||||||
|
width: 200
|
||||||
|
font.pixelSize: 20
|
||||||
|
model: ["erinn", "erinn (open privacy)", "supergirl", "someone else..."]
|
||||||
|
|
||||||
|
onCurrentTextChanged: {
|
||||||
|
console.log(cbInvite.text)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
Loading…
Reference in New Issue