summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-27 06:49:51 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-27 06:49:51 +0000
commit02ae8f8d8b1e0fe7ee1779351e694b527928e755 (patch)
tree295d3de3b4711ae31fa0136300c750571bf7c80d /src
parenta0398823f9384bcd4041c9a75c5ea04b29865651 (diff)
Experimental (it compiles..) channel support for /check. Not yet finished, but meh.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3769 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_check.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index c60ff0abe..0b93e0288 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -22,6 +22,7 @@ using namespace std;
#include "message.h"
#include "commands.h"
#include "inspircd.h"
+#include "helperfuncs.h"
/* $ModDesc: Provides the /check command to retrieve information on a user, channel, or IP address */
@@ -42,6 +43,10 @@ class cmd_check : public command_t
std::string checkstr;
std::string chliststr;
+ char timebuf[60];
+ struct tm *mytime;
+
+
checkstr = "304 " + std::string(user->nick) + " :CHECK";
targuser = Srv->FindNick(std::string(parameters[0]));
@@ -88,6 +93,25 @@ class cmd_check : public command_t
else if (targchan)
{
/* /check on a channel */
+ time_t creation_time = targchan->created;
+ time_t topic_time = targchan->topicset;
+
+ mytime = gmtime(&creation_time);
+ strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
+ Srv->SendTo(NULL, user, checkstr + " created " + timebuf);
+
+ if (targchan->topic[0] != 0)
+ {
+ /* there is a topic, assume topic related information exists */
+ Srv->SendTo(NULL, user, checkstr + " topic " + targchan->topic);
+ Srv->SendTo(NULL, user, checkstr + " topic_setby " + targchan->setby);
+ mytime = gmtime(&topic_time);
+ strftime(timebuf, 59, "%Y/%m/%d - %H:%M:%S", mytime);
+ Srv->SendTo(NULL, user, checkstr + " topic_setat " + timebuf);
+ }
+
+ Srv->SendTo(NULL, user, checkstr + " modes " + chanmodes(targchan, true));
+ Srv->SendTo(NULL, user, checkstr + " usercount " + ConvToStr(targchan->GetUserCounter()));
}
else
{