Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add away timestamp to the AWAY message sent server-server
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11664 e03df62e-2008-0410-955e-edbf42e46eb7
- Loading branch information
danieldg
committed
Sep 2, 2009
1 parent
62e2d69
commit b1002b7
Showing
6 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* +------------------------------------+ | ||
* | Inspire Internet Relay Chat Daemon | | ||
* +------------------------------------+ | ||
* | ||
* InspIRCd: (C) 2002-2009 InspIRCd Development Team | ||
* See: http://wiki.inspircd.org/Credits | ||
* | ||
* This program is free but copyrighted software; see | ||
* the file COPYING for details. | ||
* | ||
* --------------------------------------------------- | ||
*/ | ||
|
||
#include "inspircd.h" | ||
|
||
#include "main.h" | ||
#include "utils.h" | ||
#include "treeserver.h" | ||
#include "treesocket.h" | ||
|
||
bool TreeSocket::Away(const std::string &prefix, parameterlist ¶ms) | ||
{ | ||
User* u = this->ServerInstance->FindNick(prefix); | ||
if (!u) | ||
return true; | ||
if (params.size()) | ||
{ | ||
FOREACH_MOD(I_OnSetAway, OnSetAway(u, params[params.size() - 1])); | ||
|
||
if (params.size() > 1) | ||
u->awaytime = atoi(params[0].c_str()); | ||
else | ||
u->awaytime = ServerInstance->Time(); | ||
|
||
u->awaymsg = params[params.size() - 1]; | ||
|
||
params[params.size() - 1] = ":" + params[params.size() - 1]; | ||
} | ||
else | ||
{ | ||
FOREACH_MOD(I_OnSetAway, OnSetAway(u, "")); | ||
u->awaymsg.clear(); | ||
} | ||
Utils->DoOneToAllButSender(prefix,"AWAY",params,u->server); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters