aboutsummaryrefslogtreecommitdiff
path: root/telegram/handlers.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-05 20:16:38 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2024-05-05 20:16:38 +0300
commita74e2bcb7d3262073d05aa89140b1d202b7f179d (patch)
tree2f207931cd694c8254dc920f2174c53719e32024 /telegram/handlers.go
parenta3f6d5f77402bf4a4d3fa01297f9fd78cc69a3b3 (diff)
Mute/unmute whole chats with no argumentsv1.9.4
Diffstat (limited to 'telegram/handlers.go')
-rw-r--r--telegram/handlers.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go
index 6266292..1ccd622 100644
--- a/telegram/handlers.go
+++ b/telegram/handlers.go
@@ -235,6 +235,9 @@ func (c *Client) updateChatLastMessage(update *client.UpdateChatLastMessage) {
// message received
func (c *Client) updateNewMessage(update *client.UpdateNewMessage) {
chatId := update.Message.ChatId
+ if c.Session.IsChatIgnored(chatId) {
+ return
+ }
// guarantee sequential message delivering per chat
lock := c.getChatMessageLock(chatId)
@@ -261,6 +264,10 @@ func (c *Client) updateNewMessage(update *client.UpdateNewMessage) {
// message content updated
func (c *Client) updateMessageContent(update *client.UpdateMessageContent) {
+ if c.Session.IsChatIgnored(update.ChatId) {
+ return
+ }
+
markupFunction := c.getFormatter()
defer c.updateLastMessageHash(update.ChatId, update.MessageId, update.NewContent)
@@ -353,6 +360,10 @@ func (c *Client) updateMessageContent(update *client.UpdateMessageContent) {
// message(s) deleted
func (c *Client) updateDeleteMessages(update *client.UpdateDeleteMessages) {
if update.IsPermanent {
+ if c.Session.IsChatIgnored(update.ChatId) {
+ return
+ }
+
var deleteChar string
if c.Session.AsciiArrows {
deleteChar = "X "