forked from cwtch.im/cwtch
1
0
Fork 0

testing new message id id-ea

This commit is contained in:
erinn 2020-10-15 22:39:57 -07:00
parent bd3c032ea6
commit 9c91a89f00
2 changed files with 6 additions and 2 deletions

View File

@ -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
}

View File

@ -57,6 +57,7 @@ func main() {
os.MkdirAll("tordir/tor",0700)
tor.NewTorrc().WithHashedPassword(base64.StdEncoding.EncodeToString(key)).WithControlPort(controlPort).Build("./tordir/tor/torrc")
acn, err := tor.NewTorACNWithAuth("tordir", "", controlPort, tor.HashedPasswordAuthenticator{Password: base64.StdEncoding.EncodeToString(key)})
if err != nil {
log.Errorf("\nError connecting to Tor: %v\n", err)
os.Exit(1)
@ -77,7 +78,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))