Mercurial > pidgin
comparison libpurple/conversation.c @ 17922:43a55528ff26
propagate from branch 'im.pidgin.pidgin' (head b5c55520ae8ff7186733fd82db23a6e4452976cc)
to branch 'im.pidgin.soc.2007.finchfeat' (head 93037197c5356731d62e75b4050ca7d01b1017d6)
author | Eric Polino <aluink@pidgin.im> |
---|---|
date | Mon, 04 Jun 2007 15:12:50 +0000 |
parents | 4b18cc7b6177 |
children | 25d808baa395 7935fe8ed901 2f9eabdc6011 |
comparison
equal
deleted
inserted
replaced
17827:223a4fca43a1 | 17922:43a55528ff26 |
---|---|
1495 /* sort more important users first */ | 1495 /* sort more important users first */ |
1496 ret = (f1 > f2) ? -1 : 1; | 1496 ret = (f1 > f2) ? -1 : 1; |
1497 } else if (a->buddy != b->buddy) { | 1497 } else if (a->buddy != b->buddy) { |
1498 ret = a->buddy ? -1 : 1; | 1498 ret = a->buddy ? -1 : 1; |
1499 } else { | 1499 } else { |
1500 ret = strcasecmp(user1, user2); | 1500 ret = purple_utf8_strcasecmp(user1, user2); |
1501 } | 1501 } |
1502 | 1502 |
1503 return ret; | 1503 return ret; |
1504 } | 1504 } |
1505 | 1505 |
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); |
1958 g_return_val_if_fail(chat != NULL, NULL); | 1962 g_return_val_if_fail(chat != NULL, NULL); |
1959 g_return_val_if_fail(name != NULL, NULL); | 1963 g_return_val_if_fail(name != NULL, NULL); |
1960 | 1964 |
1961 for (l = purple_conv_chat_get_users(chat); l; l = l->next) { | 1965 for (l = purple_conv_chat_get_users(chat); l; l = l->next) { |
1962 cb = l->data; | 1966 cb = l->data; |
1963 if (!purple_utf8_strcasecmp(cb->name, name)) | 1967 if (!g_utf8_collate(cb->name, name)) |
1964 return cb; | 1968 return cb; |
1965 } | 1969 } |
1966 | 1970 |
1967 return NULL; | 1971 return NULL; |
1968 } | 1972 } |