# HG changeset patch # User Will Thompson # Date 1183145791 0 # Node ID 700b642631bc9b6843eced242e486eedc803dd9a # Parent 2177a11e169d7a0ba993ebbe660481c1b9b62c9f Remove static meify from yahoochat.c and replace use of it with purple_message_meify, to which it was identical. Clarify the documentation of the latter slightly. diff -r 2177a11e169d -r 700b642631bc libpurple/protocols/yahoo/yahoochat.c --- a/libpurple/protocols/yahoo/yahoochat.c Fri Jun 29 15:30:22 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Fri Jun 29 19:36:31 2007 +0000 @@ -785,44 +785,6 @@ g_free(eroom); } -/* borrowed from gtkconv.c */ -static gboolean -meify(char *message, size_t len) -{ - /* - * Read /me-ify: If the message (post-HTML) starts with /me, - * remove the "/me " part of it (including that space) and return TRUE. - */ - char *c; - gboolean inside_html = 0; - - /* Umm.. this would be very bad if this happens. */ - g_return_val_if_fail(message != NULL, FALSE); - - if (len == -1) - len = strlen(message); - - for (c = message; *c != '\0'; c++, len--) { - if (inside_html) { - if (*c == '>') - inside_html = FALSE; - } - else { - if (*c == '<') - inside_html = TRUE; - else - break; - } - } - - if (*c != '\0' && !g_ascii_strncasecmp(c, "/me ", 4)) { - memmove(c, c + 4, len - 3); - return TRUE; - } - - return FALSE; -} - static int yahoo_chat_send(PurpleConnection *gc, const char *dn, const char *room, const char *what, PurpleMessageFlags flags) { struct yahoo_data *yd = gc->proto_data; @@ -839,7 +801,7 @@ msg1 = g_strdup(what); - if (meify(msg1, -1)) + if (purple_message_meify(msg1, -1)) me = 1; msg2 = yahoo_html_to_codes(msg1); diff -r 2177a11e169d -r 700b642631bc libpurple/util.h --- a/libpurple/util.h Fri Jun 29 15:30:22 2007 +0000 +++ b/libpurple/util.h Fri Jun 29 19:36:31 2007 +0000 @@ -1105,12 +1105,13 @@ void purple_print_utf8_to_console(FILE *filestream, char *message); /** - * Checks for messages starting with "/me " + * Checks for messages starting (post-HTML) with "/me ", including the space. * * @param message The message to check * @param len The message length, or -1 * - * @return TRUE if it starts with /me, and it has been removed, otherwise FALSE + * @return TRUE if it starts with "/me ", and it has been removed, otherwise + * FALSE */ gboolean purple_message_meify(char *message, size_t len);