experimenting with adding additional info to appbus events
This commit is contained in:
parent
5d0bcf0846
commit
da1058f1a8
20
lib.go
20
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() {}
|
||||
//func main() {}
|
Loading…
Reference in New Issue