Mercurial > pidgin
comparison src/util.c @ 7564:54b370f7d9bf
[gaim-migrate @ 8180]
/me-ify logs, and maybe fix the random directories problem. maybe.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 19 Nov 2003 05:34:50 +0000 |
parents | 3c21f3084ff0 |
children | 3ae88e96dde2 |
comparison
equal
deleted
inserted
replaced
7563:cb9c3b6d6de9 | 7564:54b370f7d9bf |
---|---|
2099 g_free(b_norm); | 2099 g_free(b_norm); |
2100 | 2100 |
2101 return ret; | 2101 return ret; |
2102 } | 2102 } |
2103 | 2103 |
2104 gboolean gaim_message_meify(char *message, size_t len) | |
2105 { | |
2106 char *c; | |
2107 gboolean inside_html = FALSE; | |
2108 | |
2109 g_return_val_if_fail(message != NULL, FALSE); | |
2110 | |
2111 if(len == -1) | |
2112 len = strlen(message); | |
2113 | |
2114 for (c = message; *c; c++, len--) { | |
2115 if(inside_html) { | |
2116 if(*c == '>') | |
2117 inside_html = FALSE; | |
2118 } else { | |
2119 if(*c == '<') | |
2120 inside_html = TRUE; | |
2121 else | |
2122 break; | |
2123 } | |
2124 } | |
2125 | |
2126 if(*c && !g_ascii_strncasecmp(c, "/me ", 4)) { | |
2127 memmove(c, c+4, len-3); | |
2128 return TRUE; | |
2129 } | |
2130 | |
2131 return FALSE; | |
2132 } | |
2133 |