forked from cwtch.im/libcwtch-go
Merge pull request 'prune logging' (#2) from logprune into trunk
Reviewed-on: cwtch.im/libcwtch-go#2 Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
This commit is contained in:
commit
2bf1adb47c
7
lib.go
7
lib.go
|
@ -230,10 +230,10 @@ func SendAppEvent(eventJson string) {
|
||||||
// rest of the logic nicer.
|
// rest of the logic nicer.
|
||||||
var new_event event.Event
|
var new_event event.Event
|
||||||
json.Unmarshal([]byte(eventJson), &new_event)
|
json.Unmarshal([]byte(eventJson), &new_event)
|
||||||
log.Infof("Event: %v", new_event)
|
log.Debugf("Event: %v", new_event.EventType)
|
||||||
|
|
||||||
// We need to update the local cache
|
// We need to update the local cache
|
||||||
// Ideally I think this would be pusgit hed back into Cwtch
|
// Ideally I think this would be pushed back into Cwtch
|
||||||
switch new_event.EventType {
|
switch new_event.EventType {
|
||||||
case utils.UpdateGlobalSettings:
|
case utils.UpdateGlobalSettings:
|
||||||
var globalSettings utils.GlobalSettings
|
var globalSettings utils.GlobalSettings
|
||||||
|
@ -347,7 +347,6 @@ func c_GetAppBusEvent() *C.char {
|
||||||
|
|
||||||
// GetAppBusEvent blocks until an event
|
// GetAppBusEvent blocks until an event
|
||||||
func GetAppBusEvent() string {
|
func GetAppBusEvent() string {
|
||||||
log.Debugf("appbusevent called")
|
|
||||||
for eventHandler == nil {
|
for eventHandler == nil {
|
||||||
log.Debugf("waiting for eventHandler != nil")
|
log.Debugf("waiting for eventHandler != nil")
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
|
@ -355,10 +354,8 @@ func GetAppBusEvent() string {
|
||||||
|
|
||||||
var json = ""
|
var json = ""
|
||||||
for json == "" {
|
for json == "" {
|
||||||
log.Debugf("waiting for json != ''")
|
|
||||||
json = eventHandler.GetNextEvent()
|
json = eventHandler.GetNextEvent()
|
||||||
}
|
}
|
||||||
log.Debugf("appbusevent: %v", json)
|
|
||||||
return json
|
return json
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -362,7 +362,7 @@ func (eh *EventHandler) startHandlingPeer(onion string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (eh *EventHandler) forwardProfileMessages(onion string, q event.Queue) {
|
func (eh *EventHandler) forwardProfileMessages(onion string, q event.Queue) {
|
||||||
log.Infof("Launching Forwarding Goroutine for %v", onion)
|
log.Infof("Launching Forwarding Goroutine")
|
||||||
// TODO: graceful shutdown, via an injected event of special QUIT type exiting loop/go routine
|
// TODO: graceful shutdown, via an injected event of special QUIT type exiting loop/go routine
|
||||||
for {
|
for {
|
||||||
e := q.Next()
|
e := q.Next()
|
||||||
|
|
|
@ -247,7 +247,6 @@ func NewManager(profile string, gcd *GrandCentralDispatcher) Manager {
|
||||||
// uiManager.AddContact(onion)
|
// uiManager.AddContact(onion)
|
||||||
// (handle string, displayName string, image string, badge int, status int, authorization string, loading bool, lastMsgTime int)
|
// (handle string, displayName string, image string, badge int, status int, authorization string, loading bool, lastMsgTime int)
|
||||||
func EnrichNewPeer(handle string, ph *PeerHelper, ev *EventProfileEnvelope) error {
|
func EnrichNewPeer(handle string, ph *PeerHelper, ev *EventProfileEnvelope) error {
|
||||||
log.Infof("Enriching New Peer %v", handle)
|
|
||||||
if ph.IsGroup(handle) {
|
if ph.IsGroup(handle) {
|
||||||
group := ph.peer.GetGroup(handle)
|
group := ph.peer.GetGroup(handle)
|
||||||
if group != nil {
|
if group != nil {
|
||||||
|
|
Loading…
Reference in New Issue