Changeset 4469e7e
- Timestamp:
- 2010-06-03T22:17:11Z (14 years ago)
- Branches:
- master
- Children:
- 2b8473c
- Parents:
- 7b71feb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_commands.c
r7b71feb r4469e7e 529 529 } 530 530 531 #if 0532 531 static void irc_cmd_topic( irc_t *irc, char **cmd ) 533 532 { 534 char *channel = cmd[1]; 535 char *topic = cmd[2]; 536 537 if( topic ) 538 { 539 /* Send the topic */ 540 struct groupchat *c = irc_chat_by_channel( irc, channel ); 541 if( c && c->ic && c->ic->acc->prpl->chat_topic ) 542 c->ic->acc->prpl->chat_topic( c, topic ); 543 } 544 else 545 { 546 /* Get the topic */ 547 irc_topic( irc, channel ); 548 } 549 } 550 #endif 533 irc_channel_t *ic = irc_channel_by_name( irc, cmd[1] ); 534 const char *new = cmd[2]; 535 536 if( ic == NULL ) 537 { 538 irc_send_num( irc, 403, "%s :No such channel", cmd[1] ); 539 } 540 else if( new ) 541 { 542 if( ic->f->topic == NULL ) 543 irc_send_num( irc, 482, "%s :Can't change this channel's topic", ic->name ); 544 else if( ic->f->topic( ic, new ) ) 545 irc_send_topic( ic, TRUE ); 546 } 547 else 548 { 549 irc_send_topic( ic, FALSE ); 550 } 551 } 551 552 552 553 static void irc_cmd_away( irc_t *irc, char **cmd ) … … 637 638 #if 0 638 639 { "notice", 1, irc_cmd_privmsg, IRC_CMD_LOGGED_IN }, 640 #endif 639 641 { "topic", 1, irc_cmd_topic, IRC_CMD_LOGGED_IN }, 640 #endif641 642 { "oper", 2, irc_cmd_oper, IRC_CMD_LOGGED_IN }, 642 643 { "die", 0, NULL, IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER }, -
irc_im.c
r7b71feb r4469e7e 477 477 static gboolean bee_irc_channel_chat_topic( irc_channel_t *ic, const char *new ) 478 478 { 479 return TRUE; 479 struct groupchat *c = ic->data; 480 char *topic = g_strdup( new ); /* TODO: Need more const goodness here, sigh */ 481 482 if( c->ic->acc->prpl->chat_topic == NULL ) 483 irc_send_num( ic->irc, 482, "%s :IM network does not support channel topics", ic->name ); 484 else 485 { 486 c->ic->acc->prpl->chat_topic( c, topic ); 487 return TRUE; 488 } 489 490 return FALSE; 480 491 } 481 492
Note: See TracChangeset
for help on using the changeset viewer.