projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5a9d04e
)
give an external script the possibility to log the execution
author
pk910
<philipp@zoelle1.de>
Sun, 25 Dec 2011 21:00:19 +0000
(22:00 +0100)
committer
pk910
<philipp@zoelle1.de>
Sun, 25 Dec 2011 21:00:19 +0000
(22:00 +0100)
src/cmd_neonserv_extscript.c
patch
|
blob
|
history
diff --git
a/src/cmd_neonserv_extscript.c
b/src/cmd_neonserv_extscript.c
index 13f96a31b074b2dbb7f609792ec0363e6f60aec5..6342356c055959752f145c514d331219cb376ec1 100644
(file)
--- a/
src/cmd_neonserv_extscript.c
+++ b/
src/cmd_neonserv_extscript.c
@@
-28,6
+28,7
@@
static TIMEQ_CALLBACK(neonserv_cmd_extscript_callback);
struct neonserv_cmd_extscript_cache {
struct ClientSocket *client, *textclient;
struct neonserv_cmd_extscript_cache {
struct ClientSocket *client, *textclient;
+ struct Event *event;
struct UserNode *user;
struct ChanNode *chan;
int answere_channel;
struct UserNode *user;
struct ChanNode *chan;
int answere_channel;
@@
-130,6
+131,7
@@
CMD_BIND(neonserv_cmd_extscript) {
}
cache->client = client;
cache->textclient = getTextBot();
}
cache->client = client;
cache->textclient = getTextBot();
+ cache->event = event;
cache->user = user;
cache->chan = chan;
cache->answere_channel = answere_channel;
cache->user = user;
cache->chan = chan;
cache->answere_channel = answere_channel;
@@
-152,6
+154,10
@@
static TIMEQ_CALLBACK(neonserv_cmd_extscript_callback) {
while (fgets(command, 512, cache->pipe) != NULL) {
if((a = strchr(command, '\n')))
*a = '\0';
while (fgets(command, 512, cache->pipe) != NULL) {
if((a = strchr(command, '\n')))
*a = '\0';
+ if(!stricmp(command, "/log")) {
+ logEvent(cache->event);
+ continue;
+ }
if(cache->answere_channel)
putsock(cache->client, "PRIVMSG %s :%s", cache->chan->name, command);
else
if(cache->answere_channel)
putsock(cache->client, "PRIVMSG %s :%s", cache->chan->name, command);
else