Mercurial > pidgin.yaz
annotate libpurple/protocols/jabber/usernick.c @ 23661:6659ba7b3941
Fix a crash when the user isn't in your list.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 29 Jul 2008 18:55:03 +0000 |
parents | dccfd999ffe7 |
children | 5f9a24d1c25e 26eabe8e739b |
rev | line source |
---|---|
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
1 /* |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
2 * purple - Jabber Protocol Plugin |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
3 * |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
4 * Copyright (C) 2007, Andreas Monitzer <andy@monitzer.com> |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
5 * |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
6 * This program is free software; you can redistribute it and/or modify |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
9 * (at your option) any later version. |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
10 * |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
11 * This program is distributed in the hope that it will be useful, |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
14 * GNU General Public License for more details. |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
15 * |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
19 * |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
20 */ |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
21 |
19697
d32ed28cf645
Fix mingw build of xmpp prpl
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17597
diff
changeset
|
22 #include "internal.h" |
d32ed28cf645
Fix mingw build of xmpp prpl
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17597
diff
changeset
|
23 |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
24 #include "usernick.h" |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
25 #include "pep.h" |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
26 #include <string.h> |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
27 #include "internal.h" |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
28 #include "request.h" |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
29 #include "status.h" |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
30 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
31 static void jabber_nick_cb(JabberStream *js, const char *from, xmlnode *items) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
32 /* it doesn't make sense to have more than one item here, so let's just pick the first one */ |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
33 xmlnode *item = xmlnode_get_child(items, "item"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
34 JabberBuddy *buddy = jabber_buddy_find(js, from, FALSE); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
35 xmlnode *nick; |
20058
5103485b4b26
Plug some memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20000
diff
changeset
|
36 char *nickname = NULL; |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
37 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
38 /* ignore the tune of people not on our buddy list */ |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
39 if (!buddy || !item) |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
40 return; |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
41 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
42 nick = xmlnode_get_child_with_namespace(item, "nick", "http://jabber.org/protocol/nick"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
43 if (!nick) |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
44 return; |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
45 nickname = xmlnode_get_data(nick); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
46 serv_got_alias(js->gc, from, nickname); |
20058
5103485b4b26
Plug some memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20000
diff
changeset
|
47 g_free(nickname); |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
48 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
49 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
50 static void do_nick_set(JabberStream *js, const char *nick) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
51 xmlnode *publish, *nicknode; |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
52 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
53 publish = xmlnode_new("publish"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
54 xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/nick"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
55 nicknode = xmlnode_new_child(xmlnode_new_child(publish, "item"), "nick"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
56 xmlnode_set_namespace(nicknode, "http://jabber.org/protocol/nick"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
57 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
58 if(nick && nick[0] != '\0') |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
59 xmlnode_insert_data(nicknode, nick, -1); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
60 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
61 jabber_pep_publish(js, publish); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
62 /* publish is freed by jabber_pep_publish -> jabber_iq_send -> jabber_iq_free |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
63 (yay for well-defined memory management rules) */ |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
64 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
65 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
66 static void do_nick_got_own_nick_cb(JabberStream *js, const char *from, xmlnode *items) { |
20058
5103485b4b26
Plug some memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20000
diff
changeset
|
67 char *oldnickname = NULL; |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
68 xmlnode *item = xmlnode_get_child(items,"item"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
69 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
70 if(item) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
71 xmlnode *nick = xmlnode_get_child_with_namespace(item,"nick","http://jabber.org/protocol/nick"); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
72 if(nick) |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
73 oldnickname = xmlnode_get_data(nick); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
74 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
75 |
21570
dccfd999ffe7
merge of '76c07fcb434a2a7aa289734bb221c171a376d73b'
Evan Schoenberg <evan.s@dreskin.net>
parents:
21244
diff
changeset
|
76 purple_request_input(js->gc, _("Set User Nickname"), _("Please specify a new nickname for you."), |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
77 _("This information is visible to all contacts on your contact list, so choose something appropriate."), |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
78 oldnickname, FALSE, FALSE, NULL, _("Set"), PURPLE_CALLBACK(do_nick_set), _("Cancel"), NULL, |
21570
dccfd999ffe7
merge of '76c07fcb434a2a7aa289734bb221c171a376d73b'
Evan Schoenberg <evan.s@dreskin.net>
parents:
21244
diff
changeset
|
79 purple_connection_get_account(js->gc), NULL, NULL, js); |
20058
5103485b4b26
Plug some memory leaks.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
20000
diff
changeset
|
80 g_free(oldnickname); |
17597
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
81 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
82 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
83 static void do_nick_set_nick(PurplePluginAction *action) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
84 PurpleConnection *gc = (PurpleConnection *) action->context; |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
85 JabberStream *js = gc->proto_data; |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
86 char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
87 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
88 /* since the nickname might have been changed by another resource of this account, we always have to request the old one |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
89 from the server to present as the default for the new one */ |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
90 jabber_pep_request_item(js, jid, "http://jabber.org/protocol/nick", NULL, do_nick_got_own_nick_cb); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
91 g_free(jid); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
92 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
93 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
94 void jabber_nick_init(void) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
95 jabber_add_feature("nick", "http://jabber.org/protocol/nick", jabber_pep_namespace_only_when_pep_enabled_cb); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
96 jabber_pep_register_handler("nickn", "http://jabber.org/protocol/nick", jabber_nick_cb); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
97 } |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
98 |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
99 void jabber_nick_init_action(GList **m) { |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
100 PurplePluginAction *act = purple_plugin_action_new(_("Set Nickname..."), do_nick_set_nick); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
101 *m = g_list_append(*m, act); |
5f4dcaf1f886
User Nickname now sets the buddy's server_alias, which means that no UI changes are required for supporting this XEP. Also forgot to add usernick.[hc].
Andreas Monitzer <pidgin@monitzer.com>
parents:
diff
changeset
|
102 } |