Eliminate edit echos for outgoing messages
This commit is contained in:
parent
20e6d2558e
commit
f56e6ac187
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
COMMIT := $(shell git rev-parse --short HEAD)
|
COMMIT := $(shell git rev-parse --short HEAD)
|
||||||
TD_COMMIT := "5bbfc1cf5dab94f82e02f3430ded7241d4653551"
|
TD_COMMIT := "5bbfc1cf5dab94f82e02f3430ded7241d4653551"
|
||||||
VERSION := "v1.9.0"
|
VERSION := "v1.9.1"
|
||||||
MAKEOPTS := "-j4"
|
MAKEOPTS := "-j4"
|
||||||
|
|
||||||
all:
|
all:
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
goxmpp "gosrc.io/xmpp"
|
goxmpp "gosrc.io/xmpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version string = "1.9.0"
|
var version string = "1.9.1"
|
||||||
var commit string
|
var commit string
|
||||||
|
|
||||||
var sm *goxmpp.StreamManager
|
var sm *goxmpp.StreamManager
|
||||||
|
|
|
@ -244,6 +244,8 @@ func (c *Client) updateNewMessage(update *client.UpdateNewMessage) {
|
||||||
lock.Lock()
|
lock.Lock()
|
||||||
defer lock.Unlock()
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
c.updateLastMessageHash(update.Message.ChatId, update.Message.Id, update.Message.Content)
|
||||||
|
|
||||||
// ignore self outgoing messages
|
// ignore self outgoing messages
|
||||||
if update.Message.IsOutgoing &&
|
if update.Message.IsOutgoing &&
|
||||||
update.Message.SendingState != nil &&
|
update.Message.SendingState != nil &&
|
||||||
|
@ -256,8 +258,6 @@ func (c *Client) updateNewMessage(update *client.UpdateNewMessage) {
|
||||||
}).Warn("New message from chat")
|
}).Warn("New message from chat")
|
||||||
|
|
||||||
c.ProcessIncomingMessage(chatId, update.Message)
|
c.ProcessIncomingMessage(chatId, update.Message)
|
||||||
|
|
||||||
c.updateLastMessageHash(update.Message.ChatId, update.Message.Id, update.Message.Content)
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,8 +267,14 @@ func (c *Client) updateMessageContent(update *client.UpdateMessageContent) {
|
||||||
|
|
||||||
defer c.updateLastMessageHash(update.ChatId, update.MessageId, update.NewContent)
|
defer c.updateLastMessageHash(update.ChatId, update.MessageId, update.NewContent)
|
||||||
|
|
||||||
|
log.Debugf("newContent: %#v", update.NewContent)
|
||||||
|
|
||||||
|
lock := c.getChatMessageLock(update.ChatId)
|
||||||
|
lock.Lock()
|
||||||
|
lock.Unlock()
|
||||||
c.SendMessageLock.Lock()
|
c.SendMessageLock.Lock()
|
||||||
c.SendMessageLock.Unlock()
|
c.SendMessageLock.Unlock()
|
||||||
|
|
||||||
xmppId, xmppIdErr := gateway.IdsDB.GetByTgIds(c.Session.Login, c.jid, update.ChatId, update.MessageId)
|
xmppId, xmppIdErr := gateway.IdsDB.GetByTgIds(c.Session.Login, c.jid, update.ChatId, update.MessageId)
|
||||||
var ignoredResource string
|
var ignoredResource string
|
||||||
if xmppIdErr == nil {
|
if xmppIdErr == nil {
|
||||||
|
@ -286,6 +292,8 @@ func (c *Client) updateMessageContent(update *client.UpdateMessageContent) {
|
||||||
|
|
||||||
if update.NewContent.MessageContentType() == client.TypeMessageText && c.hasLastMessageHashChanged(update.ChatId, update.MessageId, update.NewContent) {
|
if update.NewContent.MessageContentType() == client.TypeMessageText && c.hasLastMessageHashChanged(update.ChatId, update.MessageId, update.NewContent) {
|
||||||
textContent := update.NewContent.(*client.MessageText)
|
textContent := update.NewContent.(*client.MessageText)
|
||||||
|
log.Debugf("textContent: %#v", textContent.Text)
|
||||||
|
|
||||||
var replaceId string
|
var replaceId string
|
||||||
sId := strconv.FormatInt(update.MessageId, 10)
|
sId := strconv.FormatInt(update.MessageId, 10)
|
||||||
var isCarbon bool
|
var isCarbon bool
|
||||||
|
|
Loading…
Reference in a new issue