diff --git a/lib.go b/lib.go index a9b71db..31b629b 100644 --- a/lib.go +++ b/lib.go @@ -1,5 +1,5 @@ -//package cwtch -package main +package cwtch +//package main import "C" import ( @@ -34,6 +34,7 @@ func c_StartCwtch(dir_c *C.char, len C.int, tor_c *C.char, torLen C.int) { func StartCwtch(appDir string, torPath string) { log.SetLevel(log.LevelDebug) + //log.ExcludeFromPattern("service.go") log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath) @@ -108,14 +109,13 @@ func c_AppBusEvent() *C.char { // GetAppBusEvent blocks until an event func GetAppBusEvent() string { - select { - case myevent := <- acnQueue.OutChan(): - return fmt.Sprintf("%v", myevent) - default: - return "" + e := appBusQueue.Next() + if e.EventType == event.NewPeer { + e.Data[event.ProfileName] = "orb Quen" + e.Data[event.Path] = "profiles/044-witch.png" } - event := appBusQueue.Next() - return fmt.Sprintf("%v", event) + ba, _ := json.Marshal(e) + return string(ba) } type Profile struct { @@ -261,4 +261,4 @@ func GetMessages(profile, handle string, start, end int) string { } // Leave as is, needed by ffi -func main() {} \ No newline at end of file +//func main() {} \ No newline at end of file