Mercurial > pidgin
comparison src/protocols/jabber/jabber.c @ 4793:677d3cb193a1
[gaim-migrate @ 5113]
this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk
function calls. Hopefully I didn't break anything.
Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp.
Two functions I never thought would be deprecated, but apparently they're
no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're
sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(),
except that it is case sensitive. Since glib doesn't currently have a
case-insensitive one, I wrote one. If you need to compare utf8 text, you
can use gaim_utf8_strcasecmp().
I have to go do dishes now.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 16 Mar 2003 00:01:49 +0000 |
parents | e23a7e166680 |
children | 4a689f8d3d2f |
comparison
equal
deleted
inserted
replaced
4792:9212d1c5b7dc | 4793:677d3cb193a1 |
---|---|
2968 xmlnode_put_attrib(x, "to", chatname); | 2968 xmlnode_put_attrib(x, "to", chatname); |
2969 g_free(chatname); | 2969 g_free(chatname); |
2970 xmlnode_put_attrib(x, "type", "groupchat"); | 2970 xmlnode_put_attrib(x, "type", "groupchat"); |
2971 | 2971 |
2972 if (message && strlen(message) > strlen("/topic ") && | 2972 if (message && strlen(message) > strlen("/topic ") && |
2973 !g_strncasecmp(message, "/topic ", strlen("/topic "))) { | 2973 !g_ascii_strncasecmp(message, "/topic ", strlen("/topic "))) { |
2974 char buf[8192]; | 2974 char buf[8192]; |
2975 y = xmlnode_insert_tag(x, "subject"); | 2975 y = xmlnode_insert_tag(x, "subject"); |
2976 xmlnode_insert_cdata(y, message + strlen("/topic "), -1); | 2976 xmlnode_insert_cdata(y, message + strlen("/topic "), -1); |
2977 y = xmlnode_insert_tag(x, "body"); | 2977 y = xmlnode_insert_tag(x, "body"); |
2978 g_snprintf(buf, sizeof(buf), "/me has changed the subject to: %s", message + strlen("/topic")); | 2978 g_snprintf(buf, sizeof(buf), "/me has changed the subject to: %s", message + strlen("/topic")); |
3023 | 3023 |
3024 /* Somebody called us with s == NULL once... */ | 3024 /* Somebody called us with s == NULL once... */ |
3025 if(s == NULL) { | 3025 if(s == NULL) { |
3026 return(NULL); | 3026 return(NULL); |
3027 } else { | 3027 } else { |
3028 u = t = g_strdup(s); | 3028 u = t = g_utf8_strdown(s, -1); |
3029 | |
3030 g_strdown(t); | |
3031 | 3029 |
3032 while (*t && (x < BUF_LEN - 1)) { | 3030 while (*t && (x < BUF_LEN - 1)) { |
3033 if (*t != ' ') | 3031 if (*t != ' ') |
3034 buf[x++] = *t; | 3032 buf[x++] = *t; |
3035 t++; | 3033 t++; |
3785 | 3783 |
3786 /* | 3784 /* |
3787 * Send only if there's actually any *information* to send | 3785 * Send only if there's actually any *information* to send |
3788 */ | 3786 */ |
3789 if((vc_node = xmlstr2xmlnode(info)) != NULL && xmlnode_get_name(vc_node) != NULL && | 3787 if((vc_node = xmlstr2xmlnode(info)) != NULL && xmlnode_get_name(vc_node) != NULL && |
3790 g_strncasecmp(xmlnode_get_name(vc_node), "vcard", 5) == 0) { | 3788 g_ascii_strncasecmp(xmlnode_get_name(vc_node), "vcard", 5) == 0) { |
3791 xmlnode_insert_tag_node(x, vc_node); | 3789 xmlnode_insert_tag_node(x, vc_node); |
3792 debug_printf("jabber: vCard packet: %s\n", xmlnode2str(x)); | 3790 debug_printf("jabber: vCard packet: %s\n", xmlnode2str(x)); |
3793 gjab_send(gjc, x); | 3791 gjab_send(gjc, x); |
3794 } | 3792 } |
3795 | 3793 |