#pragma mark - Notifications
- void SendNotification(CModule& module, const CString& sSender, const CString& sNotification, const CChan *pChannel) {
+ void SendNotification(CModule& module, const CString& sSender, const CString& sNotification, const CChan *pChannel, CString sIntent = "") {
++m_uiBadge;
MCString mcsHeaders;
const CString sNetworkID = GetNetworkID(*module.GetNetwork());
sJSON += ",\"network\": \"" + sNetworkID.Replace_n("\"", "\\\"") + "\"";
}
+ if (!sIntent.empty()) {
+ sJSON += ",\"intent\": \"" + sIntent + "\"";
+ }
sJSON += "}";
PLVHTTPSocket *pSocket = new PLVHTTPSocket(&module, "POST", GetPushEndpoint(), mcsHeaders, sJSON);
#pragma mark -
- void ParseMessage(CNick& Nick, CString& sMessage, CChan *pChannel = NULL) {
+ void ParseMessage(CNick& Nick, CString& sMessage, CChan *pChannel = NULL, CString sIntent = "") {
if (m_pNetwork->IsUserOnline() == false) {
#if defined VERSION_MAJOR && defined VERSION_MINOR && VERSION_MAJOR >= 1 && VERSION_MINOR >= 2
CString sCleanMessage = sMessage.StripControls_n();
}
if (bMention) {
- device.SendNotification(*this, Nick.GetNick(), sCleanMessage, pChannel);
+ device.SendNotification(*this, Nick.GetNick(), sCleanMessage, pChannel, sIntent);
}
}
}
return CONTINUE;
}
+ virtual EModRet OnChanAction(CNick& Nick, CChan& Channel, CString& sMessage) {
+ ParseMessage(Nick, sMessage, &Channel, "ACTION");
+ return CONTINUE;
+ }
+
virtual EModRet OnPrivMsg(CNick& Nick, CString& sMessage) {
ParseMessage(Nick, sMessage, NULL);
return CONTINUE;
return CONTINUE;
}
+ virtual EModRet OnPrivAction(CNick& Nick, CString& sMessage) {
+ ParseMessage(Nick, sMessage, NULL, "ACTION");
+ return CONTINUE;
+ }
+
#pragma mark - Commands
void HandleTestCommand(const CString& sLine) {