Changeset 0ef1c92
- Timestamp:
- 2015-09-11T02:31:10Z (9 years ago)
- Branches:
- master
- Children:
- dc96e6e
- Parents:
- 34d16d5
- git-author:
- dequis <dx@…> (27-07-15 05:14:09)
- git-committer:
- dequis <dx@…> (11-09-15 02:31:10)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r34d16d5 r0ef1c92 727 727 int irc_check_login(irc_t *irc) 728 728 { 729 if (irc->user->user && irc->user->nick ) {729 if (irc->user->user && irc->user->nick && !(irc->status & USTATUS_CAP_PENDING)) { 730 730 if (global.conf->authmode == AUTHMODE_CLOSED && !(irc->status & USTATUS_AUTHORIZED)) { 731 731 irc_send_num(irc, 464, ":This server is password-protected."); -
irc.h
r34d16d5 r0ef1c92 49 49 USTATUS_SHUTDOWN = 8, /* Now used to indicate we're shutting down. 50 50 Currently just blocks irc_vawrite(). */ 51 USTATUS_CAP_PENDING = 16, 51 52 52 53 /* Not really status stuff, but other kinds of flags: For slightly … … 331 332 irc_channel_user_flags_t old_flags, irc_channel_user_flags_t new_flags); 332 333 void irc_send_invite(irc_user_t *iu, irc_channel_t *ic); 334 void irc_send_cap(irc_t *irc, char *subcommand, char *body); 333 335 334 336 /* irc_user.c */ -
irc_commands.c
r34d16d5 r0ef1c92 28 28 #include "help.h" 29 29 #include "ipc.h" 30 31 static void irc_cmd_cap(irc_t *irc, char **cmd) 32 { 33 if (!(irc->status & USTATUS_LOGGED_IN)) { 34 /* Put registration on hold until CAP END */ 35 irc->status |= USTATUS_CAP_PENDING; 36 } 37 38 if (g_strcasecmp(cmd[1], "LS") == 0) { 39 /* gboolean irc302 = (g_strcmp0(cmd[2], "302") == 0); */ 40 irc_send_cap(irc, "LS", ""); 41 42 } else if (g_strcasecmp(cmd[1], "LIST") == 0) { 43 irc_send_cap(irc, "LIST", ""); 44 45 } else if (g_strcasecmp(cmd[1], "REQ") == 0) { 46 irc_send_cap(irc, "NAK", cmd[2] ? : ""); 47 48 } else if (g_strcasecmp(cmd[1], "END") == 0) { 49 irc->status &= ~USTATUS_CAP_PENDING; 50 irc_check_login(irc); 51 52 } else { 53 irc_send_num(irc, 410, "%s :Invalid CAP command", cmd[1]); 54 } 55 56 } 30 57 31 58 static void irc_cmd_pass(irc_t *irc, char **cmd) … … 685 712 686 713 static const command_t irc_commands[] = { 714 { "cap", 1, irc_cmd_cap, 0 }, 687 715 { "pass", 1, irc_cmd_pass, 0 }, 688 716 { "user", 4, irc_cmd_user, IRC_CMD_PRE_LOGIN }, -
irc_send.c
r34d16d5 r0ef1c92 428 428 iu->nick, iu->user, iu->host, irc->user->nick, ic->name); 429 429 } 430 431 void irc_send_cap(irc_t *irc, char *subcommand, char *body) 432 { 433 char *nick = irc->user->nick ? : "*"; 434 435 irc_write(irc, ":%s CAP %s %s :%s", irc->root->host, nick, subcommand, body); 436 }
Note: See TracChangeset
for help on using the changeset viewer.