aboutsummaryrefslogtreecommitdiff
path: root/telegram
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-08 21:49:49 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-08 21:49:49 +0300
commit2a5af5a2647f5965af6a3375d0206581727c70cd (patch)
tree748caaf2a9dedaf6192f90c84af94f6de6a0dc43 /telegram
parent06104797341533bd96ab2030d110bd843cea5098 (diff)
Add `rawmessages` configuration option
Diffstat (limited to 'telegram')
-rw-r--r--telegram/commands.go1
-rw-r--r--telegram/handlers.go2
2 files changed, 2 insertions, 1 deletions
diff --git a/telegram/commands.go b/telegram/commands.go
index e8586d8..2847ceb 100644
--- a/telegram/commands.go
+++ b/telegram/commands.go
@@ -83,6 +83,7 @@ var chatCommands = map[string]command{
var transportConfigurationOptions = map[string]configurationOption{
"timezone": configurationOption{"<timezone>", "adjust timezone for Telegram user statuses (example: +02:00)"},
"keeponline": configurationOption{"<bool>", "always keep telegram session online and rely on jabber offline messages (example: true)"},
+ "rawmessages": configurationOption{"<bool>", "do not add additional info (message id, origin etc.) to incoming messages (example: true)"},
}
type command struct {
diff --git a/telegram/handlers.go b/telegram/handlers.go
index 0eedc66..43a2291 100644
--- a/telegram/handlers.go
+++ b/telegram/handlers.go
@@ -210,7 +210,7 @@ func (c *Client) updateNewMessage(update *client.UpdateNewMessage) {
}
}
// OTR support (I do not know why would you need it, seriously)
- if !strings.HasPrefix(text, "?OTR") {
+ if !(strings.HasPrefix(text, "?OTR") || c.Session.RawMessages) {
var prefix strings.Builder
prefix.WriteString(c.messageToPrefix(update.Message, c.formatContent(file, filename)))
if text != "" {