Skip to content

Commit 9946feb

Browse files
authored
Release v1.2.7
2 parents 1770a93 + 6af919e commit 9946feb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/handler.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Handler struct {
2828
type TextMessage struct {
2929
Topic string
3030
Body string
31-
From peer.ID
31+
From string
3232
}
3333

3434
func NewHandler(pb *pubsub.PubSub, serviceTopic string, peerID peer.ID, networkTopics *mapset.Set) Handler {
@@ -55,10 +55,15 @@ func (h *Handler) HandleIncomingMessage(topic string, msg pubsub.Message, handle
5555
switch message.Flag {
5656
// Getting regular message
5757
case api.FlagGenericMessage:
58+
from := addr.String()
59+
if h.matrixID != "" {
60+
from = h.matrixID
61+
}
62+
5863
textMessage := TextMessage{
5964
Topic: topic,
6065
Body: message.Body,
61-
From: addr,
66+
From: from,
6267
}
6368
handleTextMessage(textMessage)
6469
// Getting topic request, answer topic response

0 commit comments

Comments
 (0)