I wanted to have silent notifications with the Telegram service. It's possible with Telegram API to send messages that does not produce sound or screen notifications when they are received, by adding the 'disable_notification' parameter.
In order to do that, I've patched the notifications/NotificationTelegram.cpp file to pass this parameter when the priority is low :
Code: Select all
@@ -46,6 +46,8 @@
json["chat_id"] = _chatid;
json["text"] = CURLEncode::URLDecode(Text);
//json["body"] = CURLEncode::URLDecode(Text);
+ if ( Priority < 0 )
+ json["disable_notification"] = 1;
sPostData = jsonWriter.write(json);
//Add the required Content Type
Code: Select all
@@ -2496,6 +2496,8 @@
}
else if (aParam.size() == 5)
{
+ priority = aParam[2];
+ sound = aParam[3];
subsystem = aParam[4];
}
m_sql.AddTaskItem(_tTaskItem::SendNotification(0, subject, body, std::string(""), atoi(priority.c_str()), sound, subsystem));