mirror of https://github.com/SeanOMik/znc-push.git
Implemented PM notifications
This commit is contained in:
parent
31541dda0a
commit
f5590832cc
27
notifo.cpp
27
notifo.cpp
|
@ -133,6 +133,21 @@ class CNotifoMod : public CModule
|
|||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the user of a private message.
|
||||
*
|
||||
* @param nick Nick that sent the message
|
||||
* @param message Message contents
|
||||
*/
|
||||
void notify_pm(const CNick& nick, const CString& message)
|
||||
{
|
||||
CString title = "Private Message";
|
||||
CString msg = "From " + nick.GetNick();
|
||||
msg += ": " + message;
|
||||
|
||||
send_message(msg, title);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
bool OnLoad(const CString& args, CString& message)
|
||||
|
@ -145,6 +160,18 @@ class CNotifoMod : public CModule
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a private message
|
||||
*
|
||||
* @param nick Nick that sent the message
|
||||
* @param message Message contents
|
||||
*/
|
||||
EModRet OnPrivMsg(CNick& nick, CString& message)
|
||||
{
|
||||
notify_pm(nick, message);
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle direct commands to the *notifo virtual user.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue