| 1680 const char *text) { |
1680 const char *text) { |
| 1681 struct mwGaimPluginData *pd; |
1681 struct mwGaimPluginData *pd; |
| 1682 GaimAccount *acct; |
1682 GaimAccount *acct; |
| 1683 GaimConversation *conv; |
1683 GaimConversation *conv; |
| 1684 GaimBuddy *buddy; |
1684 GaimBuddy *buddy; |
| 1685 char *who = from->user_id; |
1685 const char *who = from->user_id; |
| 1686 char *msg; |
1686 char *tmp, *msg; |
| 1687 |
1687 |
| 1688 pd = mwSession_getClientData(s); |
1688 pd = mwSession_getClientData(s); |
| 1689 acct = gaim_connection_get_account(pd->gc); |
1689 acct = gaim_connection_get_account(pd->gc); |
| 1690 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, acct); |
1690 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, who, acct); |
| 1691 if(! conv) conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, acct, who); |
1691 if(! conv) conv = gaim_conversation_new(GAIM_CONV_TYPE_IM, acct, who); |
| 1692 |
1692 |
| 1693 buddy = gaim_find_buddy(acct, who); |
1693 buddy = gaim_find_buddy(acct, who); |
| 1694 if(buddy) { |
1694 if(buddy) { |
| 1695 who = g_strdup(gaim_buddy_get_contact_alias(buddy)); |
1695 who = gaim_buddy_get_contact_alias(buddy); |
| 1696 } |
1696 } |
| 1697 |
1697 |
| 1698 who = g_strdup_printf(_("Announcement from %s"), who); |
1698 tmp = g_strdup_printf(_("Announcement from %s"), who); |
| 1699 msg = gaim_markup_linkify(text); |
1699 msg = gaim_markup_linkify(text); |
| 1700 |
1700 |
| 1701 gaim_conversation_write(conv, who, msg, GAIM_MESSAGE_RECV, time(NULL)); |
1701 gaim_conversation_write(conv, tmp, msg, GAIM_MESSAGE_RECV, time(NULL)); |
| 1702 g_free(who); |
1702 g_free(tmp); |
| 1703 g_free(msg); |
1703 g_free(msg); |
| 1704 } |
1704 } |
| 1705 |
1705 |
| 1706 |
1706 |
| 1707 static struct mwSessionHandler mw_session_handler = { |
1707 static struct mwSessionHandler mw_session_handler = { |