| 1038 * alias to their display name so that we don't see a bunch |
1038 * alias to their display name so that we don't see a bunch |
| 1039 * of numbers in the buddy list. |
1039 * of numbers in the buddy list. |
| 1040 */ |
1040 */ |
| 1041 if (display_name != NULL) { |
1041 if (display_name != NULL) { |
| 1042 purple_blist_node_set_string(PURPLE_BLIST_NODE(buddy), "DisplayName", display_name); |
1042 purple_blist_node_set_string(PURPLE_BLIST_NODE(buddy), "DisplayName", display_name); |
| 1043 serv_got_alias(session->gc, username, display_name); |
1043 purple_serv_got_alias(session->gc, username, display_name); |
| 1044 } else { |
1044 } else { |
| 1045 serv_got_alias(session->gc, username, |
1045 purple_serv_got_alias(session->gc, username, |
| 1046 purple_blist_node_get_string(PURPLE_BLIST_NODE(buddy), "DisplayName")); |
1046 purple_blist_node_get_string(PURPLE_BLIST_NODE(buddy), "DisplayName")); |
| 1047 } |
1047 } |
| 1048 } |
1048 } |
| 1049 g_free(display_name); |
1049 g_free(display_name); |
| 1050 |
1050 |
| 1519 if (!time_received) { |
1519 if (!time_received) { |
| 1520 purple_debug_info("msim_incoming_im", "date in message not set.\n"); |
1520 purple_debug_info("msim_incoming_im", "date in message not set.\n"); |
| 1521 time_received = time(NULL); |
1521 time_received = time(NULL); |
| 1522 } |
1522 } |
| 1523 |
1523 |
| 1524 serv_got_im(session->gc, username, msg_purple_markup, PURPLE_MESSAGE_RECV, time_received); |
1524 purple_serv_got_im(session->gc, username, msg_purple_markup, PURPLE_MESSAGE_RECV, time_received); |
| 1525 |
1525 |
| 1526 g_free(msg_purple_markup); |
1526 g_free(msg_purple_markup); |
| 1527 |
1527 |
| 1528 return TRUE; |
1528 return TRUE; |
| 1529 } |
1529 } |
| 1553 purple_debug_info("msim", |
1553 purple_debug_info("msim", |
| 1554 "msim_incoming_action_or_im: action <%s> from <%s>\n", |
1554 "msim_incoming_action_or_im: action <%s> from <%s>\n", |
| 1555 msg_text, username); |
1555 msg_text, username); |
| 1556 |
1556 |
| 1557 if (g_str_equal(msg_text, "%typing%")) { |
1557 if (g_str_equal(msg_text, "%typing%")) { |
| 1558 serv_got_typing(session->gc, username, 0, PURPLE_IM_TYPING); |
1558 purple_serv_got_typing(session->gc, username, 0, PURPLE_IM_TYPING); |
| 1559 rc = TRUE; |
1559 rc = TRUE; |
| 1560 } else if (g_str_equal(msg_text, "%stoptyping%")) { |
1560 } else if (g_str_equal(msg_text, "%stoptyping%")) { |
| 1561 serv_got_typing_stopped(session->gc, username); |
1561 purple_purple_serv_got_typing_stopped(session->gc, username); |
| 1562 rc = TRUE; |
1562 rc = TRUE; |
| 1563 } else if (strstr(msg_text, "!!!ZAP_SEND!!!=RTE_BTN_ZAPS_")) { |
1563 } else if (strstr(msg_text, "!!!ZAP_SEND!!!=RTE_BTN_ZAPS_")) { |
| 1564 rc = msim_incoming_zap(session, msg); |
1564 rc = msim_incoming_zap(session, msg); |
| 1565 } else if (strstr(msg_text, "!!!GroupCount=")) { |
1565 } else if (strstr(msg_text, "!!!GroupCount=")) { |
| 1566 /* TODO: support group chats. I think the number in msg_text has |
1566 /* TODO: support group chats. I think the number in msg_text has |
| 1611 purple_debug_info("msim", "msim_incoming_media: from %s, got msg=%s\n", username, text); |
1611 purple_debug_info("msim", "msim_incoming_media: from %s, got msg=%s\n", username, text); |
| 1612 |
1612 |
| 1613 /* Media messages are sent when the user opens a window to someone. |
1613 /* Media messages are sent when the user opens a window to someone. |
| 1614 * Tell libpurple they started typing and stopped typing, to inform the Psychic |
1614 * Tell libpurple they started typing and stopped typing, to inform the Psychic |
| 1615 * Mode plugin so it too can open a window to the user. */ |
1615 * Mode plugin so it too can open a window to the user. */ |
| 1616 serv_got_typing(session->gc, username, 0, PURPLE_IM_TYPING); |
1616 purple_serv_got_typing(session->gc, username, 0, PURPLE_IM_TYPING); |
| 1617 serv_got_typing_stopped(session->gc, username); |
1617 purple_purple_serv_got_typing_stopped(session->gc, username); |
| 1618 |
1618 |
| 1619 g_free(username); |
1619 g_free(username); |
| 1620 |
1620 |
| 1621 return TRUE; |
1621 return TRUE; |
| 1622 } |
1622 } |