Implemented PM notifications

This commit is contained in:
John Reese 2011-01-13 17:40:41 -05:00
parent 31541dda0a
commit f5590832cc
1 changed files with 27 additions and 0 deletions

View File

@ -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.
*