Mercurial > hg
comparison mcabber/src/commands.c @ 977:5b01de4ac5e1
Cosmetic changes
author | Alexis Hildebrandt <afh [at] 2drop [dot] net> |
---|---|
date | Tue, 10 Oct 2006 20:15:06 +0200 |
parents | 36f7753dfb59 |
children | a58dfdd6d058 |
comparison
equal
deleted
inserted
replaced
976:d530e5fb506a | 977:5b01de4ac5e1 |
---|---|
637 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); | 637 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); |
638 jid = NULL; | 638 jid = NULL; |
639 } else { | 639 } else { |
640 // Convert jid to lowercase | 640 // Convert jid to lowercase |
641 char *p = jid; | 641 char *p = jid; |
642 for ( ; *p && *p != '/'; p++) | 642 for ( ; *p && *p != JID_RESOURCE_SEPARATOR; p++) |
643 *p = tolower(*p); | 643 *p = tolower(*p); |
644 jid = jid_utf8 = to_utf8(jid); | 644 jid = jid_utf8 = to_utf8(jid); |
645 } | 645 } |
646 } else { | 646 } else { |
647 // Add the current buddy | 647 // Add the current buddy |
806 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); | 806 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); |
807 return 1; | 807 return 1; |
808 } | 808 } |
809 | 809 |
810 // We must use the bare jid in hk_message_out() | 810 // We must use the bare jid in hk_message_out() |
811 rp = strchr(jid, '/'); | 811 rp = strchr(jid, JID_RESOURCE_SEPARATOR); |
812 if (rp) bare_jid = g_strndup(jid, rp - jid); | 812 if (rp) bare_jid = g_strndup(jid, rp - jid); |
813 else bare_jid = (char*)jid; | 813 else bare_jid = (char*)jid; |
814 | 814 |
815 // Jump to window, create one if needed | 815 // Jump to window, create one if needed |
816 scr_RosterJumpJid(bare_jid); | 816 scr_RosterJumpJid(bare_jid); |
1604 // we try the "nickname" option, then the username part of the jid. | 1604 // we try the "nickname" option, then the username part of the jid. |
1605 if (!nick || !*nick) { | 1605 if (!nick || !*nick) { |
1606 nick = (char*)settings_opt_get("nickname"); | 1606 nick = (char*)settings_opt_get("nickname"); |
1607 if (!nick) { | 1607 if (!nick) { |
1608 nick = (char*)settings_opt_get("username"); | 1608 nick = (char*)settings_opt_get("username"); |
1609 if (nick && (strchr(nick, '@') > nick)) { | 1609 if (nick && (strchr(nick, JID_DOMAIN_SEPARATOR) > nick)) { |
1610 char *p; | 1610 char *p; |
1611 nick = tmpnick = g_strdup(nick); | 1611 nick = tmpnick = g_strdup(nick); |
1612 p = strchr(nick, '@'); | 1612 p = strchr(nick, JID_DOMAIN_SEPARATOR); |
1613 *p = 0; | 1613 *p = 0; |
1614 } | 1614 } |
1615 } | 1615 } |
1616 } else { | 1616 } else { |
1617 nick = tmpnick = to_utf8(nick); | 1617 nick = tmpnick = to_utf8(nick); |
2247 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); | 2247 scr_LogPrint(LPRINT_NORMAL, "<%s> is not a valid Jabber ID.", jid); |
2248 jid = NULL; | 2248 jid = NULL; |
2249 } else { | 2249 } else { |
2250 // Convert jid to lowercase | 2250 // Convert jid to lowercase |
2251 char *p; | 2251 char *p; |
2252 for (p = jid; *p && *p != '/'; p++) | 2252 for (p = jid; *p && *p != JID_RESOURCE_SEPARATOR; p++) |
2253 *p = tolower(*p); | 2253 *p = tolower(*p); |
2254 jid = jid_utf8 = to_utf8(jid); | 2254 jid = jid_utf8 = to_utf8(jid); |
2255 } | 2255 } |
2256 } else { | 2256 } else { |
2257 // Add the current buddy | 2257 // Add the current buddy |