Changeset 687ec88
- Timestamp:
- 2015-10-08T05:25:56Z (9 years ago)
- Branches:
- master
- Children:
- 2f73692
- Parents:
- 0b0bb4c
- git-author:
- dequis <dx@…> (12-09-15 08:25:33)
- git-committer:
- dequis <dx@…> (08-10-15 05:25:56)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r0b0bb4c r687ec88 67 67 68 68 typedef enum { 69 CAP_FOO = (1 << 0), 70 CAP_BAR = (1 << 1), 69 CAP_MULTI_PREFIX = (1 << 1), 71 70 } irc_cap_flag_t; 72 71 … … 309 308 gboolean irc_channel_name_hint(irc_channel_t *ic, const char *name); 310 309 void irc_channel_update_ops(irc_channel_t *ic, char *value); 310 char irc_channel_user_get_prefix(irc_channel_user_t *icu); 311 311 char *set_eval_irc_channel_ops(struct set *set, char *value); 312 312 gboolean irc_channel_wants_user(irc_channel_t *ic, irc_user_t *iu); -
irc_cap.c
r0b0bb4c r687ec88 38 38 39 39 static const cap_info_t supported_caps[] = { 40 {"foo", CAP_FOO}, 41 {"bar", CAP_BAR}, 40 {"multi-prefix", CAP_MULTI_PREFIX}, 42 41 {NULL}, 43 42 }; -
irc_channel.c
r0b0bb4c r687ec88 427 427 changes); 428 428 } 429 } 430 431 char irc_channel_user_get_prefix(irc_channel_user_t *icu) 432 { 433 if (icu->flags & IRC_CHANNEL_USER_OP) { 434 return '@'; 435 } else if (icu->flags & IRC_CHANNEL_USER_HALFOP) { 436 return '%'; 437 } else if (icu->flags & IRC_CHANNEL_USER_VOICE) { 438 return '+'; 439 } 440 return 0; 429 441 } 430 442 -
irc_send.c
r0b0bb4c r687ec88 214 214 } 215 215 216 if (icu->flags & IRC_CHANNEL_USER_OP) { 217 strcat(namelist, "@"); 218 } else if (icu->flags & IRC_CHANNEL_USER_HALFOP) { 219 strcat(namelist, "%"); 220 } else if (icu->flags & IRC_CHANNEL_USER_VOICE) { 221 strcat(namelist, "+"); 222 } 216 namelist[strlen(namelist) + 1] = '\0'; 217 namelist[strlen(namelist)] = irc_channel_user_get_prefix(icu); 223 218 224 219 strcat(namelist, iu->nick); … … 294 289 295 290 while (l) { 296 irc_user_t *iu = l->data; 291 irc_user_t *iu; 292 293 /* Null terminated string with three chars, respectively: 294 * { <H|G>, <@|%|+|\0>, \0 } */ 295 char status_prefix[3] = {0}; 296 297 /* rfc1459 doesn't mention this: G means gone, H means here */ 298 status_prefix[0] = iu->flags & IRC_USER_AWAY ? 'G' : 'H'; 299 297 300 if (is_channel) { 298 iu = ((irc_channel_user_t *) iu)->iu; 299 } 300 /* TODO(wilmer): Restore away/channel information here */ 301 irc_send_num(irc, 352, "%s %s %s %s %s %c :0 %s", 301 irc_channel_user_t *icu = l->data; 302 status_prefix[1] = irc_channel_user_get_prefix(icu); 303 iu = icu->iu; 304 } else { 305 iu = l->data; 306 } 307 308 irc_send_num(irc, 352, "%s %s %s %s %s %s :0 %s", 302 309 is_channel ? channel : "*", iu->user, iu->host, irc->root->host, 303 iu->nick, iu->flags & IRC_USER_AWAY ? 'G' : 'H', 304 iu->fullname); 310 iu->nick, status_prefix, iu->fullname); 305 311 l = l->next; 306 312 }
Note: See TracChangeset
for help on using the changeset viewer.