This commit is contained in:
erinn 2019-01-14 11:45:28 -08:00
commit e191de86dd
4 changed files with 15 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import (
"cwtch.im/ui/go/gobjects"
"cwtch.im/ui/go/the"
"git.openprivacy.ca/openprivacy/libricochet-go/channels"
"log"
"git.openprivacy.ca/openprivacy/libricochet-go/log"
)
func PostmanPat(messages chan gobjects.Letter) {
@ -31,7 +31,7 @@ func andHisBlackAndWhiteCat(incomingMessages chan gobjects.Letter) {
connection.DoOnChannel("im.ricochet.chat", channels.Outbound, func(channel *channels.Channel) {
chatchannel, ok := channel.Handler.(*channels.ChatChannel)
if ok {
log.Printf("Sending packet")
log.Debugln("Sending packet")
the.AcknowledgementIDs[chatchannel.SendMessage(m.Message)] = m.MID
}
})

View File

@ -245,7 +245,7 @@ func (this *GrandCentralDispatcher) importString(str string) {
_, err := base32.StdEncoding.DecodeString(strings.ToUpper(onion[:56]))
if err != nil {
log.Errorf("%v", err)
log.Debugln(err)
this.InvokePopup("bad format. missing characters?")
return
}

View File

@ -6,7 +6,7 @@ import (
"cwtch.im/ui/go/gobjects"
"cwtch.im/ui/go/the"
"encoding/base32"
"log"
"git.openprivacy.ca/openprivacy/libricochet-go/log"
"strings"
)
@ -32,7 +32,7 @@ func (this *InterfaceState) AddContact(c *gobjects.Contact) {
return
} else if len(c.Handle) != 56 {
log.Printf("sorry, unable to handle AddContact(%v)", c.Handle)
log.Errorf("sorry, unable to handle AddContact(%v)", c.Handle)
return
}

17
main.go
View File

@ -13,11 +13,11 @@ import (
"git.openprivacy.ca/openprivacy/libricochet-go/application"
"git.openprivacy.ca/openprivacy/libricochet-go/channels"
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
"git.openprivacy.ca/openprivacy/libricochet-go/log"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/quick"
"github.com/therecipe/qt/quickcontrols2"
"github.com/therecipe/qt/widgets"
"log"
"os"
"os/user"
"path"
@ -98,7 +98,7 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
/*_, err := app2.NewApp(dirname, "/data/data/org.qtproject.example.go/lib/libtor.so")
if err != nil {
log.Printf("ERROR CREATING CWTCH APP: %v", err)
log.Errorf("ERROR CREATING CWTCH APP: %v", err)
}
time.Sleep(time.Second * 10)
*/
@ -106,7 +106,8 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
mn, err := connectivity.StartTor(the.CwtchDir, "")
if err != nil {
log.Printf("[!!!] Could not start Tor: %v", err)
log.Errorf("Could not start Tor: %v", err)
os.Exit(1)
}
the.CwtchApp = libapp.NewApp(mn, the.CwtchDir)
@ -114,14 +115,16 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
err = the.CwtchApp.LoadProfiles("be gay do crime")
if err != nil {
//TODO no more fatalfs
log.Fatalf("couldn't load profiles: %v", err)
log.Errorf("couldn't load profiles: %v", err)
os.Exit(1)
}
if len(the.CwtchApp.ListPeers()) == 0 {
log.Printf("couldn't load your config file. attempting to create one now")
log.Infoln("couldn't load your config file. attempting to create one now")
the.Peer, err = the.CwtchApp.CreatePeer("alice", "be gay do crime")
if err != nil {
log.Fatalf("couldn't create one. is your cwtch folder writable?")
log.Errorf("couldn't create one. is your cwtch folder writable?")
os.Exit(1)
}
the.CwtchApp.SaveProfile(the.Peer)
} else {
@ -162,7 +165,7 @@ func loadCwtchData(gcd *gothings.GrandCentralDispatcher) {
groups := the.Peer.GetGroups()
for i := range groups {
log.Printf("adding saved group %v", groups[i])
log.Infof("adding saved group %v", groups[i])
group := the.Peer.GetGroup(groups[i])
group.NewMessage = make(chan model.Message)
go characters.CwtchListener(gcd.UIState.AddMessage, groups[i], group.NewMessage)