diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 9f46acf..d9ec40f 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -418,12 +418,15 @@ func (cp *cwtchPeer) SendMessageToGroupTracked(groupid string, message string) ( func (cp *cwtchPeer) SendMessageToPeer(onion string, message string) string { event := event.NewEvent(event.SendMessageToPeer, map[event.Field]string{event.RemotePeer: onion, event.Data: message}) - cp.eventBus.Publish(event) cp.mutex.Lock() + contact, _ := cp.Profile.GetContact(onion) + event.EventID = strconv.Itoa(contact.Timeline.Len()) cp.Profile.AddSentMessageToContactTimeline(onion, message, time.Now(), event.EventID) cp.mutex.Unlock() + cp.eventBus.Publish(event) + return event.EventID } diff --git a/server/app/main.go b/server/app/main.go index 6e8dd4a..4ced0ba 100644 --- a/server/app/main.go +++ b/server/app/main.go @@ -40,7 +40,7 @@ func main() { serverConfig := cwtchserver.LoadConfig(configDir, serverConfigFile) - acn, err := tor.NewTorACNWithAuth(".", "", 9051, tor.HashedPasswordAuthenticator{Password: "examplehashedpassword"}) + acn, err := tor.NewTorACNWithAuth(".", "./tor/tor", 9010, tor.NullAuthenticator{}) if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) @@ -61,7 +61,7 @@ func main() { if err != nil { panic(err) } - fmt.Printf("%v", "torv3"+base64.StdEncoding.EncodeToString(invite)) + fmt.Printf("%v\n", "torv3"+base64.StdEncoding.EncodeToString(invite)) bundle := server.KeyBundle().Serialize() log.Infof("Server Config: server:%s", base64.StdEncoding.EncodeToString(bundle))