# HG changeset patch # User Jeffrey Connelly # Date 1181013659 0 # Node ID 1277a0f82304b7a7157e5e3c5de2e89fd9f555dd # Parent e64bcff3b674a8c220b15e1f6c7945c21bf8eaf5 Add untested implementation of msim_incoming_action(). diff -r e64bcff3b674 -r 1277a0f82304 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Tue Jun 05 02:42:46 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Tue Jun 05 03:20:59 2007 +0000 @@ -721,15 +721,38 @@ * * @return TRUE if successful. * - * INCOMPLETE + * UNTESTED */ gboolean msim_incoming_action(MsimSession *session, MsimMessage *msg) { - /* TODO: process */ - purple_debug_info("msim", "msim_incoming_action: action <%s> from <%d>\n", - msim_msg_get_string(msg, "msg"), msim_msg_get_integer(msg, "f")); + gchar *msg_text, *username; + gboolean rc; + + msg_text = msim_msg_get_string(msg, "msg"); + username = msim_msg_get_string(msg, "_username"); + + purple_debug_info("msim", "msim_incoming_action: action <%s> from <%d>\n", msg_text, username); - return FALSE; + if (strcmp(msg_text, "%typing%") == 0) + { + /* TODO: find out if msim repeatedly sends typing messages, so we can give it a timeout. */ + serv_got_typing(session->gc, username, 0, PURPLE_TYPING); + rc = TRUE; + } else if (strcmp(msg_text, "%stoptyping%") == 0) { + serv_got_typing_stopped(session->gc, username); + rc = TRUE; + } else { + /* TODO: make a function, msim_unrecognized(), that logs all unhandled msgs to file. */ + purple_debug_info("msim", "msim_incoming_action: for %s, unknown msg %s\n", + username, msg_text); + rc = FALSE; + } + + + g_free(msg_text); + g_free(username); + + return rc; } /**