func (this *Tunnelc) onToxnetSelfConnectionStatus(t *tox.Tox, status uint32, extra interface{}) { _, err := t.FriendByPublicKey(toxtunid) if err != nil { t.FriendAdd(toxtunid, "tuncli") t.WriteSavedata(fname) } info.Println(status) if status == 0 { appevt.Trigger("selfonline", false) appevt.Trigger("selfoffline") } else { appevt.Trigger("selfonline", true) } }
func (this *Tunnelc) onToxnetSelfConnectionStatus(t *tox.Tox, status uint32, extra interface{}) { toxtunid := config.recs[0].rpubkey _, err := t.FriendByPublicKey(toxtunid) if err != nil { t.FriendAdd(toxtunid, "tuncli") t.WriteSavedata(fname) } info.Println("mytox status:", status) if status == 0 { switchServer(t) } if status == 0 { appevt.Trigger("selfonline", false) appevt.Trigger("selfoffline") } else { appevt.Trigger("selfonline", true) } }