comparison libpurple/conversation.c @ 17484:4b18cc7b6177

don't show your own alias (half the time) when in a chatroom where no one else's alias shows (protocols with OPT_PROTO_UNIQUE_CHATNAME set)
author Nathan Walp <nwalp@pidgin.im>
date Mon, 04 Jun 2007 13:35:26 +0000
parents 6418bcb7809a
children 25d808baa395 7935fe8ed901 2f9eabdc6011
comparison
equal deleted inserted replaced
17474:2217b738a890 17484:4b18cc7b6177
1533 const char *alias = user; 1533 const char *alias = user;
1534 gboolean quiet; 1534 gboolean quiet;
1535 PurpleConvChatBuddyFlags flag = GPOINTER_TO_INT(fl->data); 1535 PurpleConvChatBuddyFlags flag = GPOINTER_TO_INT(fl->data);
1536 const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL); 1536 const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL);
1537 1537
1538 if (!strcmp(chat->nick, purple_normalize(conv->account, user))) { 1538 if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
1539 const char *alias2 = purple_account_get_alias(conv->account); 1539 if (!strcmp(chat->nick, purple_normalize(conv->account, user))) {
1540 if (alias2 != NULL) 1540 const char *alias2 = purple_account_get_alias(conv->account);
1541 alias = alias2; 1541 if (alias2 != NULL)
1542 else 1542 alias = alias2;
1543 { 1543 else
1544 const char *display_name = purple_connection_get_display_name(gc); 1544 {
1545 if (display_name != NULL) 1545 const char *display_name = purple_connection_get_display_name(gc);
1546 alias = display_name; 1546 if (display_name != NULL)
1547 alias = display_name;
1548 }
1549 } else {
1550 PurpleBuddy *buddy;
1551 if ((buddy = purple_find_buddy(gc->account, user)) != NULL)
1552 alias = purple_buddy_get_contact_alias(buddy);
1547 } 1553 }
1548 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
1549 PurpleBuddy *buddy;
1550 if ((buddy = purple_find_buddy(gc->account, user)) != NULL)
1551 alias = purple_buddy_get_contact_alias(buddy);
1552 } 1554 }
1553 1555
1554 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), 1556 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(),
1555 "chat-buddy-joining", conv, user, flag)) | 1557 "chat-buddy-joining", conv, user, flag)) |
1556 purple_conv_chat_is_user_ignored(chat, user); 1558 purple_conv_chat_is_user_ignored(chat, user);
1631 const char *alias; 1633 const char *alias;
1632 1634
1633 /* Note this for later. */ 1635 /* Note this for later. */
1634 is_me = TRUE; 1636 is_me = TRUE;
1635 1637
1636 alias = purple_account_get_alias(conv->account); 1638 if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
1637 if (alias != NULL) 1639 alias = purple_account_get_alias(conv->account);
1638 new_alias = alias; 1640 if (alias != NULL)
1639 else 1641 new_alias = alias;
1640 { 1642 else
1641 const char *display_name = purple_connection_get_display_name(gc); 1643 {
1642 if (display_name != NULL) 1644 const char *display_name = purple_connection_get_display_name(gc);
1643 alias = display_name; 1645 if (display_name != NULL)
1646 alias = display_name;
1647 }
1644 } 1648 }
1645 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { 1649 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
1646 PurpleBuddy *buddy; 1650 PurpleBuddy *buddy;
1647 if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL) 1651 if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL)
1648 new_alias = purple_buddy_get_contact_alias(buddy); 1652 new_alias = purple_buddy_get_contact_alias(buddy);