Reply own messages
This commit is contained in:
parent
7215d11d79
commit
945b9c063b
|
@ -114,6 +114,15 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) {
|
||||||
var err error
|
var err error
|
||||||
text := msg.Body
|
text := msg.Body
|
||||||
if len(reply.Id) > 0 {
|
if len(reply.Id) > 0 {
|
||||||
|
chatId, msgId, err := gateway.IdsDB.GetByXmppId(session.Session.Login, bare, reply.Id)
|
||||||
|
if err == nil {
|
||||||
|
if chatId != toID {
|
||||||
|
log.Warnf("Chat mismatch: %v ≠ %v", chatId, toID)
|
||||||
|
} else {
|
||||||
|
replyId = msgId
|
||||||
|
log.Debugf("replace tg: %#v %#v", chatId, msgId)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
id := reply.Id
|
id := reply.Id
|
||||||
if id[0] == 'e' {
|
if id[0] == 'e' {
|
||||||
id = id[1:]
|
id = id[1:]
|
||||||
|
@ -122,6 +131,7 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn(errors.Wrap(err, "Failed to parse message ID!"))
|
log.Warn(errors.Wrap(err, "Failed to parse message ID!"))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if replyId != 0 && fallback.For == "urn:xmpp:reply:0" && len(fallback.Body) > 0 {
|
if replyId != 0 && fallback.For == "urn:xmpp:reply:0" && len(fallback.Body) > 0 {
|
||||||
body := fallback.Body[0]
|
body := fallback.Body[0]
|
||||||
|
|
Loading…
Reference in a new issue