65 |
} |
} |
66 |
|
|
67 |
/* |
/* |
68 |
|
* irc_cmd_send_admin: find information about the administrator of the server |
69 |
|
*/ |
70 |
|
|
71 |
|
int |
72 |
|
irc_cmd_send_admin (t_irc_server *server, char *arguments) |
73 |
|
{ |
74 |
|
if (arguments) |
75 |
|
server_sendf (server, "ADMIN %s\r\n", arguments); |
76 |
|
else |
77 |
|
server_sendf (server, "ADMIN\r\n"); |
78 |
|
return 0; |
79 |
|
} |
80 |
|
|
81 |
|
/* |
82 |
* irc_cmd_send_away: toggle away status |
* irc_cmd_send_away: toggle away status |
83 |
*/ |
*/ |
84 |
|
|
279 |
} |
} |
280 |
|
|
281 |
/* |
/* |
282 |
|
* irc_cmd_send_links: list all servernames which are known by the server |
283 |
|
* answering the query |
284 |
|
*/ |
285 |
|
|
286 |
|
int |
287 |
|
irc_cmd_send_links (t_irc_server *server, char *arguments) |
288 |
|
{ |
289 |
|
if (arguments) |
290 |
|
server_sendf (server, "LINKS %s\r\n", arguments); |
291 |
|
else |
292 |
|
server_sendf (server, "LINKS\r\n"); |
293 |
|
return 0; |
294 |
|
} |
295 |
|
|
296 |
|
/* |
297 |
* irc_cmd_send_list: close client-server connection |
* irc_cmd_send_list: close client-server connection |
298 |
*/ |
*/ |
299 |
|
|
308 |
} |
} |
309 |
|
|
310 |
/* |
/* |
311 |
|
* irc_cmd_send_lusers: get statistics about ths size of the IRC network |
312 |
|
*/ |
313 |
|
|
314 |
|
int |
315 |
|
irc_cmd_send_lusers (t_irc_server *server, char *arguments) |
316 |
|
{ |
317 |
|
if (arguments) |
318 |
|
server_sendf (server, "LUSERS %s\r\n", arguments); |
319 |
|
else |
320 |
|
server_sendf (server, "LUSERS\r\n"); |
321 |
|
return 0; |
322 |
|
} |
323 |
|
|
324 |
|
/* |
325 |
* irc_cmd_send_me: send a ctcp action to the current channel |
* irc_cmd_send_me: send a ctcp action to the current channel |
326 |
*/ |
*/ |
327 |
|
|
478 |
} |
} |
479 |
|
|
480 |
/* |
/* |
481 |
|
* irc_cmd_send_motd: get the "Message Of The Day" |
482 |
|
*/ |
483 |
|
|
484 |
|
int |
485 |
|
irc_cmd_send_motd (t_irc_server *server, char *arguments) |
486 |
|
{ |
487 |
|
if (arguments) |
488 |
|
server_sendf (server, "MOTD %s\r\n", arguments); |
489 |
|
else |
490 |
|
server_sendf (server, "MOTD\r\n"); |
491 |
|
return 0; |
492 |
|
} |
493 |
|
|
494 |
|
/* |
495 |
* irc_cmd_send_names: list nicknames on channels |
* irc_cmd_send_names: list nicknames on channels |
496 |
*/ |
*/ |
497 |
|
|
571 |
*/ |
*/ |
572 |
|
|
573 |
int |
int |
574 |
irc_cmd_send_oper (t_irc_server *server, int argc, char **argv) |
irc_cmd_send_oper (t_irc_server *server, char *arguments) |
575 |
{ |
{ |
576 |
if (argc != 2) |
server_sendf (server, "OPER %s %s\r\n", arguments); |
|
return -1; |
|
|
server_sendf (server, "OPER %s %s\r\n", argv[0], argv[1]); |
|
577 |
return 0; |
return 0; |
578 |
} |
} |
579 |
|
|
648 |
*/ |
*/ |
649 |
|
|
650 |
int |
int |
651 |
irc_cmd_send_ping (t_irc_server *server, int argc, char **argv) |
irc_cmd_send_ping (t_irc_server *server, char *arguments) |
652 |
{ |
{ |
653 |
if (argc == 1) |
server_sendf (server, "PING %s\r\n", arguments); |
|
server_sendf (server, "PING %s\r\n", argv[0]); |
|
|
if (argc == 2) |
|
|
server_sendf (server, "PING %s %s\r\n", argv[0], |
|
|
argv[1]); |
|
654 |
return 0; |
return 0; |
655 |
} |
} |
656 |
|
|
659 |
*/ |
*/ |
660 |
|
|
661 |
int |
int |
662 |
irc_cmd_send_pong (t_irc_server *server, int argc, char **argv) |
irc_cmd_send_pong (t_irc_server *server, char *arguments) |
663 |
{ |
{ |
664 |
if (argc == 1) |
server_sendf (server, "PONG %s\r\n", arguments); |
|
server_sendf (server, "PONG %s\r\n", argv[0]); |
|
|
if (argc == 2) |
|
|
server_sendf (server, "PONG %s %s\r\n", argv[0], |
|
|
argv[1]); |
|
665 |
return 0; |
return 0; |
666 |
} |
} |
667 |
|
|
723 |
} |
} |
724 |
|
|
725 |
/* |
/* |
726 |
|
* irc_cmd_send_service: register a new service |
727 |
|
*/ |
728 |
|
|
729 |
|
int |
730 |
|
irc_cmd_send_service (t_irc_server *server, char *arguments) |
731 |
|
{ |
732 |
|
server_sendf (server, "SERVICE %s\r\n", arguments); |
733 |
|
return 0; |
734 |
|
} |
735 |
|
|
736 |
|
/* |
737 |
|
* irc_cmd_send_squit: disconnect server links |
738 |
|
*/ |
739 |
|
|
740 |
|
int |
741 |
|
irc_cmd_send_squit (t_irc_server *server, char *arguments) |
742 |
|
{ |
743 |
|
server_sendf (server, "SQUIT %s\r\n", arguments); |
744 |
|
return 0; |
745 |
|
} |
746 |
|
|
747 |
|
/* |
748 |
* irc_cmd_send_stats: query statistics about server |
* irc_cmd_send_stats: query statistics about server |
749 |
*/ |
*/ |
750 |
|
|
759 |
} |
} |
760 |
|
|
761 |
/* |
/* |
762 |
|
* irc_cmd_send_time: query local time from server |
763 |
|
*/ |
764 |
|
|
765 |
|
int |
766 |
|
irc_cmd_send_time (t_irc_server *server, char *arguments) |
767 |
|
{ |
768 |
|
if (arguments) |
769 |
|
server_sendf (server, "TIME %s\r\n", arguments); |
770 |
|
else |
771 |
|
server_sendf (server, "TIME\r\n"); |
772 |
|
return 0; |
773 |
|
} |
774 |
|
|
775 |
|
/* |
776 |
* irc_cmd_send_topic: get/set topic for a channel |
* irc_cmd_send_topic: get/set topic for a channel |
777 |
*/ |
*/ |
778 |
|
|
828 |
return 0; |
return 0; |
829 |
} |
} |
830 |
|
|
831 |
|
/* |
832 |
|
* irc_cmd_send_trace: find the route to specific server |
833 |
|
*/ |
834 |
|
|
835 |
|
int |
836 |
|
irc_cmd_send_trace (t_irc_server *server, char *arguments) |
837 |
|
{ |
838 |
|
if (arguments) |
839 |
|
server_sendf (server, "TRACE %s\r\n", arguments); |
840 |
|
else |
841 |
|
server_sendf (server, "TRACE\r\n"); |
842 |
|
return 0; |
843 |
|
} |
844 |
|
|
845 |
/* |
/* |
846 |
* irc_cmd_send_version: gives the version info of nick or server (current or specified) |
* irc_cmd_send_version: gives the version info of nick or server (current or specified) |
847 |
*/ |
*/ |