experimenting with adding additional info to appbus events

This commit is contained in:
erinn 2021-02-03 05:22:52 -08:00
parent 5d0bcf0846
commit da1058f1a8
1 changed files with 10 additions and 10 deletions

20
lib.go
View File

@ -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() {}
//func main() {}