Changeset dbb0ce3
- Timestamp:
- 2010-04-11T19:38:45Z (15 years ago)
- Branches:
- master
- Children:
- ffa1173
- Parents:
- e00da63
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
re00da63 rdbb0ce3 567 567 } 568 568 569 #if 0570 569 static void cmd_add( irc_t *irc, char **cmd ) 571 570 { … … 580 579 } 581 580 582 if( !( a = account_get( irc , cmd[1] ) ) )581 if( !( a = account_get( irc->b, cmd[1] ) ) ) 583 582 { 584 583 irc_usermsg( irc, "Invalid account" ); … … 598 597 return; 599 598 } 600 else if( user_find( irc, cmd[3] ) )599 else if( irc_user_by_name( irc, cmd[3] ) ) 601 600 { 602 601 irc_usermsg( irc, "The requested nick `%s' already exists", cmd[3] ); … … 612 611 a->ic->acc->prpl->add_buddy( a->ic, cmd[2], NULL ); 613 612 else 614 /* Yeah, officially this is a call-*back*... So if we just 615 called add_buddy, we'll wait for the IM server to respond 616 before we do this. */ 617 imcb_add_buddy( a->ic, cmd[2], NULL ); 613 /* Only for add -tmp. For regular adds, this callback will 614 be called once the IM server confirms. */ 615 bee_user_new( irc->b, a->ic, cmd[2] ); 618 616 619 617 irc_usermsg( irc, "Adding `%s' to your contact list", cmd[2] ); 620 618 } 621 619 620 static void cmd_remove( irc_t *irc, char **cmd ) 621 { 622 irc_user_t *iu; 623 bee_user_t *bu; 624 char *s; 625 626 if( !( iu = irc_user_by_name( irc, cmd[1] ) ) || !( bu = iu->bu ) ) 627 { 628 irc_usermsg( irc, "Buddy `%s' not found", cmd[1] ); 629 return; 630 } 631 s = g_strdup( bu->handle ); 632 633 bu->ic->acc->prpl->remove_buddy( bu->ic, bu->handle, NULL ); 634 nick_del( bu->ic->acc, bu->handle ); 635 irc_user_free( irc, cmd[1] ); 636 637 irc_usermsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] ); 638 g_free( s ); 639 640 return; 641 } 642 643 #if 0 622 644 static void cmd_info( irc_t *irc, char **cmd ) 623 645 { … … 733 755 } 734 756 735 static void cmd_remove( irc_t *irc, char **cmd )736 {737 user_t *u;738 char *s;739 740 if( !( u = user_find( irc, cmd[1] ) ) || !u->ic )741 {742 irc_usermsg( irc, "Buddy `%s' not found", cmd[1] );743 return;744 }745 s = g_strdup( u->handle );746 747 u->ic->acc->prpl->remove_buddy( u->ic, u->handle, NULL );748 nick_del( u->ic->acc, u->handle );749 user_del( irc, cmd[1] );750 751 irc_usermsg( irc, "Buddy `%s' (nick %s) removed from contact list", s, cmd[1] );752 g_free( s );753 754 return;755 }756 757 757 static void cmd_block( irc_t *irc, char **cmd ) 758 758 { … … 873 873 } 874 874 } 875 #endif 875 876 876 877 static void cmd_yesno( irc_t *irc, char **cmd ) … … 917 918 } 918 919 920 #if 0 919 921 static void cmd_blist( irc_t *irc, char **cmd ) 920 922 { … … 1184 1186 { "drop", 1, cmd_drop, 0 }, 1185 1187 { "save", 0, cmd_save, 0 }, 1188 { "add", 2, cmd_add, 0 }, 1189 { "remove", 1, cmd_remove, 0 }, 1186 1190 #if 0 1187 { "add", 2, cmd_add, 0 },1188 1191 { "info", 1, cmd_info, 0 }, 1189 1192 #endif 1190 1193 { "rename", 2, cmd_rename, 0 }, 1191 1194 #if 0 1192 { "remove", 1, cmd_remove, 0 },1193 1195 { "block", 1, cmd_block, 0 }, 1194 1196 { "allow", 1, cmd_allow, 0 }, 1197 #endif 1195 1198 { "set", 0, cmd_set, 0 }, 1196 1199 { "yes", 0, cmd_yesno, 0 }, 1197 1200 { "no", 0, cmd_yesno, 0 }, 1201 #if 0 1198 1202 { "blist", 0, cmd_blist, 0 }, 1199 1203 { "nick", 1, cmd_nick, 0 },
Note: See TracChangeset
for help on using the changeset viewer.