Changes in irc_im.c [e3e2059:5ebff60]
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
re3e2059 r5ebff60 235 235 } else { 236 236 /* Modules can swallow messages. */ 237 goto cleanup;237 return TRUE; 238 238 } 239 239 } … … 250 250 wrapped = word_wrap(msg, 425); 251 251 irc_send_msg(iu, "PRIVMSG", dst, wrapped, prefix); 252 252 253 g_free(wrapped); 253 254 cleanup:255 254 g_free(prefix); 256 255 g_free(msg); … … 292 291 293 292 irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL); 294 295 g_string_free(msg, TRUE);296 293 297 294 return TRUE; … … 696 693 static gboolean bee_irc_chat_name_hint(bee_t *bee, struct groupchat *c, const char *name) 697 694 { 698 return irc_channel_name_hint(c->ui_data, name); 695 irc_t *irc = bee->ui_data; 696 irc_channel_t *ic = c->ui_data, *oic; 697 char stripped[MAX_NICK_LENGTH + 1], *full_name; 698 699 if (ic == NULL) { 700 return FALSE; 701 } 702 703 /* Don't rename a channel if the user's in it already. */ 704 if (ic->flags & IRC_CHANNEL_JOINED) { 705 return FALSE; 706 } 707 708 strncpy(stripped, name, MAX_NICK_LENGTH); 709 stripped[MAX_NICK_LENGTH] = '\0'; 710 irc_channel_name_strip(stripped); 711 if (set_getbool(&bee->set, "lcnicks")) { 712 nick_lc(irc, stripped); 713 } 714 715 if (stripped[0] == '\0') { 716 return FALSE; 717 } 718 719 full_name = g_strdup_printf("#%s", stripped); 720 if ((oic = irc_channel_by_name(irc, full_name))) { 721 char *type, *chat_type; 722 723 type = set_getstr(&oic->set, "type"); 724 chat_type = set_getstr(&oic->set, "chat_type"); 725 726 if (type && chat_type && oic->data == FALSE && 727 strcmp(type, "chat") == 0 && 728 strcmp(chat_type, "groupchat") == 0) { 729 /* There's a channel with this name already, but it looks 730 like it's not in use yet. Most likely the IRC client 731 rejoined the channel after a reconnect. Remove it so 732 we can reuse its name. */ 733 irc_channel_free(oic); 734 } else { 735 g_free(full_name); 736 return FALSE; 737 } 738 } 739 740 g_free(ic->name); 741 ic->name = full_name; 742 743 return TRUE; 699 744 } 700 745
Note: See TracChangeset
for help on using the changeset viewer.