comparison libpurple/protocols/jabber/buddy.c @ 29111:4ab6f0479bc5

strchr() is safe when searching for an ASCII character in UTF8 strings.
author Paul Aurich <paul@darkrain42.org>
date Tue, 01 Dec 2009 16:46:57 +0000
parents 9ae3e70a327b
children cfcf5076b73f
comparison
equal deleted inserted replaced
29109:6ebacc1710b2 29111:4ab6f0479bc5
1858 * 1858 *
1859 * According to stpeter, there is no way to know if a jid on the roster is a gateway without sending a disco#info. 1859 * According to stpeter, there is no way to know if a jid on the roster is a gateway without sending a disco#info.
1860 * However, since the gateway might appear offline to us, we cannot get that information. Therefore, I just assume 1860 * However, since the gateway might appear offline to us, we cannot get that information. Therefore, I just assume
1861 * that gateways on the roster can be identified by having no '@' in their jid. This is a faily safe assumption, since 1861 * that gateways on the roster can be identified by having no '@' in their jid. This is a faily safe assumption, since
1862 * people don't tend to have a server or other service there. 1862 * people don't tend to have a server or other service there.
1863 *
1864 * TODO: Use disco#info...
1863 */ 1865 */
1864 if (g_utf8_strchr(name, -1, '@') == NULL) { 1866 if (strchr(name, '@') == NULL) {
1865 act = purple_menu_action_new(_("Log In"), 1867 act = purple_menu_action_new(_("Log In"),
1866 PURPLE_CALLBACK(jabber_buddy_login), 1868 PURPLE_CALLBACK(jabber_buddy_login),
1867 NULL, NULL); 1869 NULL, NULL);
1868 m = g_list_append(m, act); 1870 m = g_list_append(m, act);
1869 act = purple_menu_action_new(_("Log Out"), 1871 act = purple_menu_action_new(_("Log Out"),