allow custom message handling #325
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue