From 02578440cd02ceb6716f17acd9a77288bda1a561 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Fri, 29 Sep 2023 16:59:13 -0400 Subject: Detect the "Have no write access to the chat" error from Telegram --- xmpp/gateway/gateway.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xmpp/gateway/gateway.go') diff --git a/xmpp/gateway/gateway.go b/xmpp/gateway/gateway.go index 9a42077..09cd42f 100644 --- a/xmpp/gateway/gateway.go +++ b/xmpp/gateway/gateway.go @@ -140,6 +140,9 @@ func sendMessageWrapper(to, from, body, subject, id string, component *xmpp.Comp case 400: message.Error.Type = stanza.ErrorTypeModify message.Error.Reason = "bad-request" + case 403: + message.Error.Type = stanza.ErrorTypeAuth + message.Error.Reason = "forbidden" case 404: message.Error.Type = stanza.ErrorTypeCancel message.Error.Reason = "item-not-found" -- cgit v1.2.3