28 |
#include <unistd.h> |
#include <unistd.h> |
29 |
#include <stdio.h> |
#include <stdio.h> |
30 |
#include <string.h> |
#include <string.h> |
31 |
|
#include <sys/time.h> |
32 |
#include <time.h> |
#include <time.h> |
33 |
#include <sys/utsname.h> |
#include <sys/utsname.h> |
34 |
|
|
127 |
irc_cmd_send_ctcp (t_irc_server *server, char *arguments) |
irc_cmd_send_ctcp (t_irc_server *server, char *arguments) |
128 |
{ |
{ |
129 |
char *pos, *pos2; |
char *pos, *pos2; |
130 |
|
struct timeval tv; |
131 |
|
struct timezone tz; |
132 |
|
|
133 |
pos = strchr (arguments, ' '); |
pos = strchr (arguments, ' '); |
134 |
if (pos) |
if (pos) |
166 |
server_sendf (server, "PRIVMSG %s :\01ACTION\01\r\n", |
server_sendf (server, "PRIVMSG %s :\01ACTION\01\r\n", |
167 |
arguments); |
arguments); |
168 |
} |
} |
169 |
|
if (strcasecmp (pos, "ping") == 0) |
170 |
|
{ |
171 |
|
gettimeofday (&tv, &tz); |
172 |
|
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n", |
173 |
|
arguments, tv.tv_sec, tv.tv_usec); |
174 |
|
} |
175 |
|
|
176 |
} |
} |
177 |
return 0; |
return 0; |