Mercurial > pidgin
comparison libpurple/conversation.c @ 23418:ded0a9cf1785
merge of '3d0b19df4a52ab42b61494afac9c85d170398fa8'
and '9017d2519c3dbbb02402b0785a4750aab2e18a56'
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Thu, 03 Jul 2008 14:51:52 +0000 |
parents | 0b6475f97648 |
children | abf8ebd4c9e1 |
comparison
equal
deleted
inserted
replaced
23414:1ca49b349037 | 23418:ded0a9cf1785 |
---|---|
1619 alias = purple_buddy_get_contact_alias(buddy); | 1619 alias = purple_buddy_get_contact_alias(buddy); |
1620 } | 1620 } |
1621 } | 1621 } |
1622 | 1622 |
1623 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), | 1623 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(), |
1624 "chat-buddy-joining", conv, user, flag)) | | 1624 "chat-buddy-joining", conv, user, flag)) || |
1625 purple_conv_chat_is_user_ignored(chat, user); | 1625 purple_conv_chat_is_user_ignored(chat, user); |
1626 | 1626 |
1627 cbuddy = purple_conv_chat_cb_new(user, alias, flag); | 1627 cbuddy = purple_conv_chat_cb_new(user, alias, flag); |
1628 cbuddy->buddy = purple_find_buddy(conv->account, user) != NULL; | 1628 cbuddy->buddy = purple_find_buddy(conv->account, user) != NULL; |
1629 /* This seems dumb. Why should we set users thousands of times? */ | 1629 /* This seems dumb. Why should we set users thousands of times? */ |
1631 g_list_prepend(chat->in_room, cbuddy)); | 1631 g_list_prepend(chat->in_room, cbuddy)); |
1632 | 1632 |
1633 cbuddies = g_list_prepend(cbuddies, cbuddy); | 1633 cbuddies = g_list_prepend(cbuddies, cbuddy); |
1634 | 1634 |
1635 if (!quiet && new_arrivals) { | 1635 if (!quiet && new_arrivals) { |
1636 char *escaped = g_markup_escape_text(alias, -1); | 1636 char *alias_esc = g_markup_escape_text(alias, -1); |
1637 char *tmp; | 1637 char *tmp; |
1638 | 1638 |
1639 if (extra_msg == NULL) | 1639 if (extra_msg == NULL) |
1640 tmp = g_strdup_printf(_("%s entered the room."), escaped); | 1640 tmp = g_strdup_printf(_("%s entered the room."), alias_esc); |
1641 else { | 1641 else { |
1642 char *escaped2 = g_markup_escape_text(extra_msg, -1); | 1642 char *extra_msg_esc = g_markup_escape_text(extra_msg, -1); |
1643 tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."), | 1643 tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."), |
1644 escaped, escaped2); | 1644 alias_esc, extra_msg_esc); |
1645 g_free(escaped2); | 1645 g_free(extra_msg_esc); |
1646 } | 1646 } |
1647 g_free(escaped); | 1647 g_free(alias_esc); |
1648 | 1648 |
1649 purple_conversation_write(conv, NULL, tmp, | 1649 purple_conversation_write(conv, NULL, tmp, |
1650 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, | 1650 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
1651 time(NULL)); | 1651 time(NULL)); |
1652 g_free(tmp); | 1652 g_free(tmp); |
1830 | 1830 |
1831 /* NOTE: Don't remove them from ignored in case they re-enter. */ | 1831 /* NOTE: Don't remove them from ignored in case they re-enter. */ |
1832 | 1832 |
1833 if (!quiet) { | 1833 if (!quiet) { |
1834 const char *alias = user; | 1834 const char *alias = user; |
1835 char *escaped; | 1835 char *alias_esc; |
1836 char *tmp; | 1836 char *tmp; |
1837 | 1837 |
1838 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { | 1838 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) { |
1839 PurpleBuddy *buddy; | 1839 PurpleBuddy *buddy; |
1840 | 1840 |
1841 if ((buddy = purple_find_buddy(gc->account, user)) != NULL) | 1841 if ((buddy = purple_find_buddy(gc->account, user)) != NULL) |
1842 alias = purple_buddy_get_contact_alias(buddy); | 1842 alias = purple_buddy_get_contact_alias(buddy); |
1843 } | 1843 } |
1844 | 1844 |
1845 escaped = g_markup_escape_text(alias, -1); | 1845 alias_esc = g_markup_escape_text(alias, -1); |
1846 | 1846 |
1847 if (reason == NULL || !*reason) | 1847 if (reason == NULL || !*reason) |
1848 tmp = g_strdup_printf(_("%s left the room."), escaped); | 1848 tmp = g_strdup_printf(_("%s left the room."), alias_esc); |
1849 else { | 1849 else { |
1850 char *escaped2 = g_markup_escape_text(reason, -1); | 1850 char *reason_esc = g_markup_escape_text(reason, -1); |
1851 tmp = g_strdup_printf(_("%s left the room (%s)."), | 1851 tmp = g_strdup_printf(_("%s left the room (%s)."), |
1852 escaped, escaped2); | 1852 alias_esc, reason_esc); |
1853 g_free(escaped2); | 1853 g_free(reason_esc); |
1854 } | 1854 } |
1855 g_free(escaped); | 1855 g_free(alias_esc); |
1856 | 1856 |
1857 purple_conversation_write(conv, NULL, tmp, | 1857 purple_conversation_write(conv, NULL, tmp, |
1858 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, | 1858 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, |
1859 time(NULL)); | 1859 time(NULL)); |
1860 g_free(tmp); | 1860 g_free(tmp); |