mirror of https://github.com/SeanOMik/znc-push.git
Add notice handling
* Update idle time when the user sends a notice * Send incoming channel & private notices through the existing notification pipeline Does not add any special handling of notices vs. regular PRIVMSGs or ACTIONs; all three message types will appear the same.
This commit is contained in:
parent
0a36b1cf96
commit
601efce52c
49
push.cpp
49
push.cpp
|
@ -1271,6 +1271,25 @@ class CPushMod : public CModule
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle channel notices.
|
||||||
|
*
|
||||||
|
* @param nick Nick that sent the notice
|
||||||
|
* @param channel Channel the notice was sent to
|
||||||
|
* @param message Notice contents
|
||||||
|
*/
|
||||||
|
EModRet OnChanNotice(CNick& nick, CChan& channel, CString& message)
|
||||||
|
{
|
||||||
|
if (notify_channel(nick, channel, message))
|
||||||
|
{
|
||||||
|
CString title = "Channel Notice";
|
||||||
|
|
||||||
|
send_message(message, title, channel.GetName(), nick);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a private message.
|
* Handle a private message.
|
||||||
*
|
*
|
||||||
|
@ -1307,6 +1326,24 @@ class CPushMod : public CModule
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle a private notice.
|
||||||
|
*
|
||||||
|
* @param nick Nick that sent the notice
|
||||||
|
* @param message Notice contents
|
||||||
|
*/
|
||||||
|
EModRet OnPrivNotice(CNick& nick, CString& message)
|
||||||
|
{
|
||||||
|
if (notify_pm(nick, message))
|
||||||
|
{
|
||||||
|
CString title = "Private Notice";
|
||||||
|
|
||||||
|
send_message(message, title, nick.GetNick(), nick);
|
||||||
|
}
|
||||||
|
|
||||||
|
return CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a message sent by the user.
|
* Handle a message sent by the user.
|
||||||
*
|
*
|
||||||
|
@ -1331,6 +1368,18 @@ class CPushMod : public CModule
|
||||||
return CONTINUE;
|
return CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle a notice sent by the user.
|
||||||
|
*
|
||||||
|
* @param target Target channel or nick
|
||||||
|
* @param message Notice contents
|
||||||
|
*/
|
||||||
|
EModRet OnUserNotice(CString& target, CString& message)
|
||||||
|
{
|
||||||
|
last_reply_time[target] = last_active_time[target] = idle_time = time(NULL);
|
||||||
|
return CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the user joining a channel.
|
* Handle the user joining a channel.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue