Mercurial > pidgin
annotate libpurple/protocols/bonjour/bonjour.c @ 32765:60bd913072f7
Minor refactoring of purple_media_backend_fs2_codecs_ready()
This simplifies the upcoming farstream changes.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 04 Apr 2012 22:54:48 +0000 |
parents | 7c33eaed54e5 |
children | a5b556ac1de5 |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15822 | 2 * purple - Bonjour Protocol Plugin |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15822 | 4 * Purple is the legal property of its developers, whose names are too numerous |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
6 * source distribution. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19664
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 #include <glib.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 #ifndef _WIN32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include <pwd.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #define UNICODE |
22907
1c87e81c44fa
Bonjour build fixes for MSVC.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22228
diff
changeset
|
27 #include <winsock2.h> |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include <windows.h> |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include <lm.h> |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
30 #include "dns_sd_proxy.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #endif |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "account.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "accountopt.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "version.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #include "bonjour.h" |
17495
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16904
diff
changeset
|
42 #include "mdns_common.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 #include "jabber.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 #include "buddy.h" |
21437
db7fa42845f6
Patch from some Intel folks to implement file transfer in Bonjour using XEP-0096 and 0065. This hopefully will work with Gaijm (haven't yet tested) and, of course, between libpurple instances; it will not work with Adium or iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21418
diff
changeset
|
45 #include "bonjour_ft.h" |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 static char *default_firstname; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
48 static char *default_lastname; |
30583
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
49 |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
50 const char * |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
51 bonjour_get_jid(PurpleAccount *account) |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
52 { |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
53 PurpleConnection *conn = purple_account_get_connection(account); |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
54 BonjourData *bd = conn->proto_data; |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
55 return bd->jid; |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
56 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 static void |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
59 bonjour_removeallfromlocal(PurpleConnection *conn, PurpleGroup *bonjour_group) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 { |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
61 PurpleAccount *account = purple_connection_get_account(conn); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
62 PurpleBlistNode *cnode, *cnodenext, *bnode, *bnodenext; |
15822 | 63 PurpleBuddy *buddy; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
64 |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
65 if (bonjour_group == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 /* Go through and remove all buddies that belong to this account */ |
24338
c06b85e1d020
Fix Bonjour to work with the hidden structs, except for proto_data.
Richard Laager <rlaager@wiktel.com>
parents:
23538
diff
changeset
|
69 for (cnode = purple_blist_node_get_first_child((PurpleBlistNode *) bonjour_group); cnode; cnode = cnodenext) { |
c06b85e1d020
Fix Bonjour to work with the hidden structs, except for proto_data.
Richard Laager <rlaager@wiktel.com>
parents:
23538
diff
changeset
|
70 cnodenext = purple_blist_node_get_sibling_next(cnode); |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
71 if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 continue; |
24338
c06b85e1d020
Fix Bonjour to work with the hidden structs, except for proto_data.
Richard Laager <rlaager@wiktel.com>
parents:
23538
diff
changeset
|
73 for (bnode = purple_blist_node_get_first_child(cnode); bnode; bnode = bnodenext) { |
c06b85e1d020
Fix Bonjour to work with the hidden structs, except for proto_data.
Richard Laager <rlaager@wiktel.com>
parents:
23538
diff
changeset
|
74 bnodenext = purple_blist_node_get_sibling_next(bnode); |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
75 if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 continue; |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
77 buddy = (PurpleBuddy *) bnode; |
24338
c06b85e1d020
Fix Bonjour to work with the hidden structs, except for proto_data.
Richard Laager <rlaager@wiktel.com>
parents:
23538
diff
changeset
|
78 if (purple_buddy_get_account(buddy) != account) |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
79 continue; |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
80 purple_account_remove_buddy(account, buddy, NULL); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
81 purple_blist_remove_buddy(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 } |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
84 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 static void |
15822 | 88 bonjour_login(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 { |
15822 | 90 PurpleConnection *gc = purple_account_get_connection(account); |
17541
a62a695ccfb5
Improve Bonjour error handling when there are errors "connecting".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17501
diff
changeset
|
91 BonjourData *bd; |
15822 | 92 PurpleStatus *status; |
93 PurplePresence *presence; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
95 #ifdef _WIN32 |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
96 if (!dns_sd_available()) { |
21358 | 97 purple_connection_error_reason(gc, |
27370
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
98 PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
99 _("Unable to find Apple's \"Bonjour for Windows\" toolkit, see " |
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
100 "http://d.pidgin.im/BonjourWindows for more information.")); |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
101 return; |
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
102 } |
27370
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
103 #endif /* _WIN32 */ |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
104 |
15822 | 105 gc->flags |= PURPLE_CONNECTION_HTML; |
17541
a62a695ccfb5
Improve Bonjour error handling when there are errors "connecting".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17501
diff
changeset
|
106 gc->proto_data = bd = g_new0(BonjourData, 1); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 /* Start waiting for jabber connections (iChat style) */ |
21829
cc0809ec0c85
This is the second part of the fix to support having multiple presence records in Bonjour (and also supporting multiple presences using the same IP). Incoming conversations are no longer immediately attached to a buddy - we use an algorithm to match a conversation to a buddy based on the IP and, if possible the "from" attribute of the stream or the first tag in the stream. Thanks to Sjoerd Simons from Telepahy Salut for noticing and suggesting the algorithm. Fixes #4187. It'd be good if a few people test this.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21654
diff
changeset
|
109 bd->jabber_data = g_new0(BonjourJabber, 1); |
29481
755219afed9f
Implementation of IPv6 support for Bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29478
diff
changeset
|
110 bd->jabber_data->socket = -1; |
755219afed9f
Implementation of IPv6 support for Bonjour
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29478
diff
changeset
|
111 bd->jabber_data->socket6 = -1; |
25497
f38799160cfa
Better support running many Bonjour clients on the same machine by allowing a
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24703
diff
changeset
|
112 bd->jabber_data->port = purple_account_get_int(account, "port", BONJOUR_DEFAULT_PORT); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 bd->jabber_data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 if (bonjour_jabber_start(bd->jabber_data) == -1) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 /* Send a message about the connection error */ |
21358 | 117 purple_connection_error_reason (gc, |
27370
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
118 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, |
97947f51b221
Change the wording in a connection error message. I'm trying to make
Mark Doliner <mark@kingant.net>
parents:
26352
diff
changeset
|
119 _("Unable to listen for incoming IM connections")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 /* Connect to the mDNS daemon looking for buddies in the LAN */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
124 bd->dns_sd_data = bonjour_dns_sd_new(); |
15822 | 125 bd->dns_sd_data->first = g_strdup(purple_account_get_string(account, "first", default_firstname)); |
126 bd->dns_sd_data->last = g_strdup(purple_account_get_string(account, "last", default_lastname)); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 bd->dns_sd_data->port_p2pj = bd->jabber_data->port; |
17501
c96b085ddf5c
Clean up Bonjour service publishing and improve XEP-0174 compliance.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17495
diff
changeset
|
128 /* Not engaged in AV conference */ |
c96b085ddf5c
Clean up Bonjour service publishing and improve XEP-0174 compliance.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17495
diff
changeset
|
129 bd->dns_sd_data->vc = g_strdup("!"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 |
15822 | 131 status = purple_account_get_active_status(account); |
132 presence = purple_account_get_presence(account); | |
133 if (purple_presence_is_available(presence)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 bd->dns_sd_data->status = g_strdup("avail"); |
15822 | 135 else if (purple_presence_is_idle(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 bd->dns_sd_data->status = g_strdup("away"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 bd->dns_sd_data->status = g_strdup("dnd"); |
15822 | 139 bd->dns_sd_data->msg = g_strdup(purple_status_get_attr_string(status, "message")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
141 bd->dns_sd_data->account = account; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 if (!bonjour_dns_sd_start(bd->dns_sd_data)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 { |
21358 | 144 purple_connection_error_reason (gc, |
145 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, | |
20070
efadfc6e2117
Fix up Bonjour to use purple_connection_error_reason.
Will Thompson <will.thompson@collabora.co.uk>
parents:
19681
diff
changeset
|
146 _("Unable to establish connection with the local mDNS server. Is it running?")); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
150 bonjour_dns_sd_update_buddy_icon(bd->dns_sd_data); |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
151 |
15822 | 152 /* Show the buddy list by telling Purple we have already connected */ |
153 purple_connection_set_state(gc, PURPLE_CONNECTED); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
155 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 static void |
15822 | 157 bonjour_close(PurpleConnection *connection) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 { |
15822 | 159 PurpleGroup *bonjour_group; |
17541
a62a695ccfb5
Improve Bonjour error handling when there are errors "connecting".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17501
diff
changeset
|
160 BonjourData *bd = connection->proto_data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
162 bonjour_group = purple_find_group(BONJOUR_GROUP_NAME); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
163 |
21529
d3ac933fae46
Now that the buddies are being removed from the list correctly, it needs to happen before the dns_sd stuff is cleaned up when we disconnect so that it doesn't crash the avahi implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
164 /* Remove all the bonjour buddies */ |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
165 bonjour_removeallfromlocal(connection, bonjour_group); |
21529
d3ac933fae46
Now that the buddies are being removed from the list correctly, it needs to happen before the dns_sd stuff is cleaned up when we disconnect so that it doesn't crash the avahi implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
166 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 /* Stop looking for buddies in the LAN */ |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
168 if (bd != NULL && bd->dns_sd_data != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 bonjour_dns_sd_stop(bd->dns_sd_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 bonjour_dns_sd_free(bd->dns_sd_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 |
20308
c2d3c9fc71b5
applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da
Luke Schierer <lschiere@pidgin.im>
parents:
19681
diff
changeset
|
174 if (bd != NULL && bd->jabber_data != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 /* Stop waiting for conversations */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
177 bonjour_jabber_stop(bd->jabber_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
178 g_free(bd->jabber_data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
180 |
29940
cd857e9b7281
Fix a status change event being triggered for each online Bonjour buddy when you sign out.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29847
diff
changeset
|
181 /* Delete the bonjour group |
cd857e9b7281
Fix a status change event being triggered for each online Bonjour buddy when you sign out.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29847
diff
changeset
|
182 * (purple_blist_remove_group will bail out if the group isn't empty) |
cd857e9b7281
Fix a status change event being triggered for each online Bonjour buddy when you sign out.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
29847
diff
changeset
|
183 */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
184 if (bonjour_group != NULL) |
15822 | 185 purple_blist_remove_group(bonjour_group); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
186 |
21522
dc703f13449a
Fix a couple bugs in the Bonjour XEP-0065 implementation, mainly related to error handling, but also send a <streamhost-used /> result. Also fix a XEP-0096 bug where the SI profile wasn't being specified. These bring ft with gajim closer to working, but we aren't there yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21437
diff
changeset
|
187 /* Cancel any file transfers */ |
dc703f13449a
Fix a couple bugs in the Bonjour XEP-0065 implementation, mainly related to error handling, but also send a <streamhost-used /> result. Also fix a XEP-0096 bug where the SI profile wasn't being specified. These bring ft with gajim closer to working, but we aren't there yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21437
diff
changeset
|
188 while (bd != NULL && bd->xfer_lists) { |
dc703f13449a
Fix a couple bugs in the Bonjour XEP-0065 implementation, mainly related to error handling, but also send a <streamhost-used /> result. Also fix a XEP-0096 bug where the SI profile wasn't being specified. These bring ft with gajim closer to working, but we aren't there yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21437
diff
changeset
|
189 purple_xfer_cancel_local(bd->xfer_lists->data); |
dc703f13449a
Fix a couple bugs in the Bonjour XEP-0065 implementation, mainly related to error handling, but also send a <streamhost-used /> result. Also fix a XEP-0096 bug where the SI profile wasn't being specified. These bring ft with gajim closer to working, but we aren't there yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21437
diff
changeset
|
190 } |
dc703f13449a
Fix a couple bugs in the Bonjour XEP-0065 implementation, mainly related to error handling, but also send a <streamhost-used /> result. Also fix a XEP-0096 bug where the SI profile wasn't being specified. These bring ft with gajim closer to working, but we aren't there yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21437
diff
changeset
|
191 |
30633
7a4f51a1e156
Fix crash when attempting to log into a bonjour account and init failed
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30583
diff
changeset
|
192 if (bd != NULL) |
7a4f51a1e156
Fix crash when attempting to log into a bonjour account and init failed
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30583
diff
changeset
|
193 g_free(bd->jid); |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
20308
diff
changeset
|
194 g_free(bd); |
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
20308
diff
changeset
|
195 connection->proto_data = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
196 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 static const char * |
15822 | 199 bonjour_list_icon(PurpleAccount *account, PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 return BONJOUR_ICON_NAME; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 static int |
15822 | 205 bonjour_send_im(PurpleConnection *connection, const char *to, const char *msg, PurpleMessageFlags flags) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
206 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 if(!to || !msg) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 return bonjour_jabber_send_message(((BonjourData*)(connection->proto_data))->jabber_data, to, msg); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 static void |
15822 | 214 bonjour_set_status(PurpleAccount *account, PurpleStatus *status) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 { |
15822 | 216 PurpleConnection *gc; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 BonjourData *bd; |
15822 | 218 PurplePresence *presence; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
219 const char *message, *bonjour_status; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 gchar *stripped; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
221 |
15822 | 222 gc = purple_account_get_connection(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 bd = gc->proto_data; |
15822 | 224 presence = purple_account_get_presence(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
225 |
15822 | 226 message = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 if (message == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 message = ""; |
15822 | 229 stripped = purple_markup_strip_html(message); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 * The three possible status for Bonjour are |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 * -available ("avail") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 * -idle ("away") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 * -away ("dnd") |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 * Each of them can have an optional message. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 */ |
15822 | 238 if (purple_presence_is_available(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 bonjour_status = "avail"; |
15822 | 240 else if (purple_presence_is_idle(presence)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 bonjour_status = "away"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 bonjour_status = "dnd"; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 bonjour_dns_sd_send_status(bd->dns_sd_data, bonjour_status, stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 g_free(stripped); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 |
21654
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
249 /* |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
250 * The add_buddy callback removes the buddy from the local list. |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
251 * Bonjour manages buddies for you, and adding someone locally by |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
252 * hand is stupid. Perhaps we should change libpurple not to allow adding |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
253 * if there is no add_buddy callback. |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
254 */ |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
255 static void |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
256 bonjour_fake_add_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group) { |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
257 purple_debug_error("bonjour", "Buddy '%s' manually added; removing. " |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
258 "Bonjour buddies must be discovered and not manually added.\n", |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
259 purple_buddy_get_name(buddy)); |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
260 |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
261 /* I suppose we could alert the user here, but it seems unnecessary. */ |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
262 |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
263 /* If this causes problems, it can be moved to an idle callback */ |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
264 purple_blist_remove_buddy(buddy); |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
265 } |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
266 |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
267 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18857
diff
changeset
|
268 static void bonjour_remove_buddy(PurpleConnection *pc, PurpleBuddy *buddy, PurpleGroup *group) { |
25788
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
269 BonjourBuddy *bb = purple_buddy_get_protocol_data(buddy); |
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
270 if (bb) { |
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
271 bonjour_buddy_delete(bb); |
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
272 purple_buddy_set_protocol_data(buddy, NULL); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18857
diff
changeset
|
273 } |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18857
diff
changeset
|
274 } |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18857
diff
changeset
|
275 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 static GList * |
15822 | 277 bonjour_status_types(PurpleAccount *account) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 GList *status_types = NULL; |
15822 | 280 PurpleStatusType *type; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 g_return_val_if_fail(account != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 |
15822 | 284 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 BONJOUR_STATUS_ID_AVAILABLE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 "message", _("Message"), |
15822 | 288 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 status_types = g_list_append(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 |
15822 | 291 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 BONJOUR_STATUS_ID_AWAY, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 NULL, TRUE, TRUE, FALSE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 "message", _("Message"), |
15822 | 295 purple_value_new(PURPLE_TYPE_STRING), NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 status_types = g_list_append(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
297 |
15822 | 298 type = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 BONJOUR_STATUS_ID_OFFLINE, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 NULL, TRUE, TRUE, FALSE); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
301 status_types = g_list_append(status_types, type); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
302 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 return status_types; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 static void |
15822 | 307 bonjour_convo_closed(PurpleConnection *connection, const char *who) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 { |
15822 | 309 PurpleBuddy *buddy = purple_find_buddy(connection->account, who); |
17556
612dc5149964
Close conversation connections when logging out of the Bonjour account. This also fixes leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17553
diff
changeset
|
310 BonjourBuddy *bb; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 |
25788
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
312 if (buddy == NULL || (bb = purple_buddy_get_protocol_data(buddy)) == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
314 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
315 * This buddy is not in our buddy list, and therefore does not really |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
316 * exist, so we won't have any data about them. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 |
17556
612dc5149964
Close conversation connections when logging out of the Bonjour account. This also fixes leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17553
diff
changeset
|
321 bonjour_jabber_close_conversation(bb->conversation); |
612dc5149964
Close conversation connections when logging out of the Bonjour account. This also fixes leakage.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17553
diff
changeset
|
322 bb->conversation = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
325 static |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
326 void bonjour_set_buddy_icon(PurpleConnection *conn, PurpleStoredImage *img) |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
327 { |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
328 BonjourData *bd = conn->proto_data; |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
329 bonjour_dns_sd_update_buddy_icon(bd->dns_sd_data); |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
330 } |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
331 |
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
332 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 static char * |
15822 | 334 bonjour_status_text(PurpleBuddy *buddy) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 { |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
336 const PurplePresence *presence; |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
337 const PurpleStatus *status; |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
338 const char *message; |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
339 gchar *ret = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
340 |
15822 | 341 presence = purple_buddy_get_presence(buddy); |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
342 status = purple_presence_get_active_status(presence); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
344 message = purple_status_get_attr_string(status, "message"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
345 |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
346 if (message != NULL) { |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
347 ret = g_markup_escape_text(message, -1); |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
348 purple_util_chrreplace(ret, '\n', ' '); |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
349 } |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
350 |
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
351 return ret; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
354 static void |
15822 | 355 bonjour_tooltip_text(PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 { |
15822 | 357 PurplePresence *presence; |
358 PurpleStatus *status; | |
25788
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
359 BonjourBuddy *bb = purple_buddy_get_protocol_data(buddy); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 const char *status_description; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 const char *message; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 |
15822 | 363 presence = purple_buddy_get_presence(buddy); |
364 status = purple_presence_get_active_status(presence); | |
365 message = purple_status_get_attr_string(status, "message"); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
366 |
15822 | 367 if (purple_presence_is_available(presence)) |
368 status_description = purple_status_get_name(status); | |
369 else if (purple_presence_is_idle(presence)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
370 status_description = _("Idle"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
371 else |
15822 | 372 status_description = purple_status_get_name(status); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
373 |
15822 | 374 purple_notify_user_info_add_pair(user_info, _("Status"), status_description); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 if (message != NULL) |
15822 | 376 purple_notify_user_info_add_pair(user_info, _("Message"), message); |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
377 |
21654
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
378 if (bb == NULL) { |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
379 purple_debug_error("bonjour", "Got tooltip request for a buddy without protocol data.\n"); |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
380 return; |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
381 } |
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
382 |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
383 /* Only show first/last name if there is a nickname set (to avoid duplication) */ |
24703
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
384 if (bb->nick != NULL && *bb->nick != '\0') { |
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
385 if (bb->first != NULL && *bb->first != '\0') |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
386 purple_notify_user_info_add_pair(user_info, _("First name"), bb->first); |
24703
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
387 if (bb->last != NULL && *bb->last != '\0') |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
388 purple_notify_user_info_add_pair(user_info, _("Last name"), bb->last); |
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
389 } |
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
390 |
24703
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
391 if (bb->email != NULL && *bb->email != '\0') |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23170
diff
changeset
|
392 purple_notify_user_info_add_pair(user_info, _("Email"), bb->email); |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
393 |
24703
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
394 if (bb->AIM != NULL && *bb->AIM != '\0') |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
395 purple_notify_user_info_add_pair(user_info, _("AIM Account"), bb->AIM); |
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
396 |
24703
efe41c4e0df0
Fix Bonjour to better deal with buddy values set to the empty string.
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
397 if (bb->jid != NULL && *bb->jid != '\0') |
18857
bc9b78ba996a
Add data to the bonjour tooltip.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18856
diff
changeset
|
398 purple_notify_user_info_add_pair(user_info, _("XMPP Account"), bb->jid); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
399 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
400 |
30583
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
401 static void |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
402 bonjour_do_group_change(PurpleBuddy *buddy, const char *new_group) { |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
403 PurpleBlistNodeFlags oldflags; |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
404 |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
405 if (buddy == NULL) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
406 return; |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
407 |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
408 oldflags = purple_blist_node_get_flags((PurpleBlistNode *)buddy); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
409 |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
410 /* If we're moving them out of the bonjour group, make them persistent */ |
28853
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
411 if (purple_strequal(new_group, BONJOUR_GROUP_NAME)) |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
412 purple_blist_node_set_flags((PurpleBlistNode *)buddy, oldflags | PURPLE_BLIST_NODE_FLAG_NO_SAVE); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
413 else |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
414 purple_blist_node_set_flags((PurpleBlistNode *)buddy, oldflags ^ PURPLE_BLIST_NODE_FLAG_NO_SAVE); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
415 |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
416 } |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
417 |
28853
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
418 static void |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
419 bonjour_group_buddy(PurpleConnection *connection, const char *who, const char *old_group, const char *new_group) |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
420 { |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
421 PurpleBuddy *buddy = purple_find_buddy(connection->account, who); |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
422 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
423 bonjour_do_group_change(buddy, new_group); |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
424 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
425 } |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
426 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
427 static void |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
428 bonjour_rename_group(PurpleConnection *connection, const char *old_name, PurpleGroup *group, GList *moved_buddies) |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
429 { |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
430 GList *cur; |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
431 const char *new_group; |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
432 PurpleBuddy *buddy; |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
433 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
434 new_group = purple_group_get_name(group); |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
435 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
436 for (cur = moved_buddies; cur; cur = cur->next) { |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
437 buddy = cur->data; |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
438 bonjour_do_group_change(buddy, new_group); |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
439 } |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
440 |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
441 } |
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
442 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 static gboolean |
23092
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
444 bonjour_can_receive_file(PurpleConnection *connection, const char *who) |
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
445 { |
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
446 PurpleBuddy *buddy = purple_find_buddy(connection->account, who); |
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
447 |
25788
ac967ea95b05
Use purple_buddy_get_protocol_data() and purple_buddy_set_protocol_data()
Richard Laager <rlaager@wiktel.com>
parents:
24338
diff
changeset
|
448 return (buddy != NULL && purple_buddy_get_protocol_data(buddy) != NULL); |
23092
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
449 } |
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
450 |
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
451 static gboolean |
15822 | 452 plugin_unload(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 { |
17553
61005dea822b
Cleanup, fix a leak and prevent the inbound xml from being parsed twice for every message.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17541
diff
changeset
|
454 /* These shouldn't happen here because they are allocated in _init() */ |
61005dea822b
Cleanup, fix a leak and prevent the inbound xml from being parsed twice for every message.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17541
diff
changeset
|
455 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 g_free(default_firstname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
457 g_free(default_lastname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
458 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
459 return TRUE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
460 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
461 |
15822 | 462 static PurplePlugin *my_protocol = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 |
15822 | 464 static PurplePluginProtocolInfo prpl_info = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
466 OPT_PROTO_NO_PASSWORD, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
467 NULL, /* user_splits */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 NULL, /* protocol_options */ |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
469 {"png,gif,jpeg", 0, 0, 96, 96, 65535, PURPLE_ICON_SCALE_DISPLAY}, /* icon_spec */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
470 bonjour_list_icon, /* list_icon */ |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
471 NULL, /* list_emblem */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
472 bonjour_status_text, /* status_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
473 bonjour_tooltip_text, /* tooltip_text */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
474 bonjour_status_types, /* status_types */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
475 NULL, /* blist_node_menu */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
476 NULL, /* chat_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 NULL, /* chat_info_defaults */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 bonjour_login, /* login */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
479 bonjour_close, /* close */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 bonjour_send_im, /* send_im */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
481 NULL, /* set_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
482 NULL, /* send_typing */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 NULL, /* get_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
484 bonjour_set_status, /* set_status */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
485 NULL, /* set_idle */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 NULL, /* change_passwd */ |
21654
32629dbb0bb9
Don't allow buddies to be manually added to Bonjour (remove the added buddy in the prpl add_buddy callback). Also, fix a crash when rendering the tooltip for one of these previously added buddies. Fixes #4045.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21529
diff
changeset
|
487 bonjour_fake_add_buddy, /* add_buddy */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
488 NULL, /* add_buddies */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18857
diff
changeset
|
489 bonjour_remove_buddy, /* remove_buddy */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 NULL, /* remove_buddies */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
491 NULL, /* add_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
492 NULL, /* add_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
493 NULL, /* rem_permit */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 NULL, /* rem_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 NULL, /* set_permit_deny */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 NULL, /* join_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
497 NULL, /* reject_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 NULL, /* get_chat_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
499 NULL, /* chat_invite */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 NULL, /* chat_leave */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 NULL, /* chat_whisper */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 NULL, /* chat_send */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 NULL, /* keepalive */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 NULL, /* register_user */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 NULL, /* get_cb_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 NULL, /* get_cb_away */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 NULL, /* alias_buddy */ |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22907
diff
changeset
|
508 bonjour_group_buddy, /* group_buddy */ |
28853
8aebd0e204e5
Allow the "Bonjour" group to be renamed and function similarly to dragging the buddies into a different group. Fixes #11052
Daniel Atallah <daniel.atallah@gmail.com>
parents:
27370
diff
changeset
|
509 bonjour_rename_group, /* rename_group */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 NULL, /* buddy_free */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 bonjour_convo_closed, /* convo_closed */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 NULL, /* normalize */ |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
513 bonjour_set_buddy_icon, /* set_buddy_icon */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 NULL, /* remove_group */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 NULL, /* get_cb_real_name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 NULL, /* set_chat_topic */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 NULL, /* find_blist_chat */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 NULL, /* roomlist_get_list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 NULL, /* roomlist_cancel */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 NULL, /* roomlist_expand_category */ |
23092
2a81912c229a
Some fixes from Eion Robb and me to prevent bonjour crashes with the newly
Daniel Atallah <daniel.atallah@gmail.com>
parents:
23009
diff
changeset
|
521 bonjour_can_receive_file, /* can_receive_file */ |
21437
db7fa42845f6
Patch from some Intel folks to implement file transfer in Bonjour using XEP-0096 and 0065. This hopefully will work with Gaijm (haven't yet tested) and, of course, between libpurple instances; it will not work with Adium or iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21418
diff
changeset
|
522 bonjour_send_file, /* send_file */ |
db7fa42845f6
Patch from some Intel folks to implement file transfer in Bonjour using XEP-0096 and 0065. This hopefully will work with Gaijm (haven't yet tested) and, of course, between libpurple instances; it will not work with Adium or iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21418
diff
changeset
|
523 bonjour_new_xfer, /* new_xfer */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 NULL, /* offline_message */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 NULL, /* whiteboard_prpl_ops */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 NULL, /* send_raw */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 NULL, /* roomlist_room_serialize */ |
23772
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
528 NULL, /* unregister_user */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
529 NULL, /* send_attention */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
530 NULL, /* get_attention_types */ |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23769
diff
changeset
|
531 sizeof(PurplePluginProtocolInfo), /* struct_size */ |
23807
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
532 NULL, /* get_account_text_table */ |
ff29208e03ef
propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5)
Sadrul Habib Chowdhury <imadil@gmail.com>
diff
changeset
|
533 NULL, /* initiate_media */ |
29478
2cb6ea4420a0
Add a NULL for PurplePluginProtocolInfo::get_moods to all the plugins I build
Paul Aurich <paul@darkrain42.org>
parents:
28853
diff
changeset
|
534 NULL, /* get_media_caps */ |
29847
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
29481
diff
changeset
|
535 NULL, /* get_moods */ |
2a436e0ce977
Add purple_account_[gs]et_public_alias functions, per discussion in d@cpi
Paul Aurich <paul@darkrain42.org>
parents:
29481
diff
changeset
|
536 NULL, /* set_public_alias */ |
31397
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30633
diff
changeset
|
537 NULL, /* get_public_alias */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30633
diff
changeset
|
538 NULL, /* add_buddy_with_invite */ |
7c33eaed54e5
Update PRPL structs with new fields.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30633
diff
changeset
|
539 NULL /* add_buddies_with_invite */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
540 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
541 |
15822 | 542 static PurplePluginInfo info = |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 { |
15822 | 544 PURPLE_PLUGIN_MAGIC, |
545 PURPLE_MAJOR_VERSION, | |
546 PURPLE_MINOR_VERSION, | |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
547 PURPLE_PLUGIN_PROTOCOL, /**< type */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
548 NULL, /**< ui_requirement */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 0, /**< flags */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 NULL, /**< dependencies */ |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
551 PURPLE_PRIORITY_DEFAULT, /**< priority */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 "prpl-bonjour", /**< id */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 "Bonjour", /**< name */ |
21030
3cc856ca2338
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <stu@nosnilmot.com>
parents:
20329
diff
changeset
|
555 DISPLAY_VERSION, /**< version */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 /** summary */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 N_("Bonjour Protocol Plugin"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 /** description */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 N_("Bonjour Protocol Plugin"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 NULL, /**< author */ |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
561 PURPLE_WEBSITE, /**< homepage */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 NULL, /**< load */ |
18856
5da32c4019ce
Show bonjour status messages in the buddy list.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
564 plugin_unload, /**< unload */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
565 NULL, /**< destroy */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 NULL, /**< ui_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 &prpl_info, /**< extra_info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 NULL, /**< prefs_info */ |
16702
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
570 NULL, |
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
571 |
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
572 /* padding */ |
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
573 NULL, |
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
574 NULL, |
56f0049d3207
Add padding to silc and bonjour to get rid of a bunch of warnings.
Mark Doliner <mark@kingant.net>
parents:
15932
diff
changeset
|
575 NULL, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 NULL |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
579 #ifdef WIN32 |
30583
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
580 static gboolean |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
581 _set_default_name_cb(gpointer data) { |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
582 gchar *fullname = data; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
583 const char *splitpoint; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
584 GList *tmp = prpl_info.protocol_options; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
585 PurpleAccountOption *option; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
587 if (!fullname) { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
588 purple_debug_info("bonjour", "Unable to look up First and Last name or Username from system; using defaults.\n"); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
589 return FALSE; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
592 g_free(default_firstname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
593 g_free(default_lastname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
594 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
595 /* Split the real name into a first and last name */ |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
596 splitpoint = strchr(fullname, ' '); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
597 if (splitpoint != NULL) { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
598 default_firstname = g_strndup(fullname, splitpoint - fullname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
599 default_lastname = g_strdup(&splitpoint[1]); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
600 } else { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
601 default_firstname = g_strdup(fullname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
602 default_lastname = g_strdup(""); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
603 } |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
604 g_free(fullname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
605 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
606 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
607 for(; tmp != NULL; tmp = tmp->next) { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
608 option = tmp->data; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
609 if (strcmp("first", purple_account_option_get_setting(option)) == 0) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
610 purple_account_option_set_default_string(option, default_firstname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
611 else if (strcmp("last", purple_account_option_get_setting(option)) == 0) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
612 purple_account_option_set_default_string(option, default_lastname); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
613 } |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
614 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
615 return FALSE; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
616 } |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
617 |
30583
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
618 static gpointer |
9c8b28dc6656
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <daniel.atallah@gmail.com>
parents:
30430
diff
changeset
|
619 _win32_name_lookup_thread(gpointer data) { |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
620 gchar *fullname = NULL; |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
621 wchar_t username[UNLEN + 1]; |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
622 DWORD dwLenUsername = UNLEN + 1; |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
623 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
624 GetUserNameW((LPWSTR) &username, &dwLenUsername); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
626 if (username != NULL && *username != '\0') { |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
627 LPBYTE servername = NULL; |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
628 LPBYTE info = NULL; |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
629 |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
630 NetGetDCName(NULL, NULL, &servername); |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
631 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
632 /* purple_debug_info("bonjour", "Looking up the full name from the %s.\n", (servername ? "domain controller" : "local machine")); */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
634 if (NetUserGetInfo((LPCWSTR) servername, username, 10, &info) == NERR_Success |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
635 && info != NULL && ((LPUSER_INFO_10) info)->usri10_full_name != NULL |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
636 && *(((LPUSER_INFO_10) info)->usri10_full_name) != '\0') { |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
637 fullname = g_utf16_to_utf8( |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
638 ((LPUSER_INFO_10) info)->usri10_full_name, |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
639 -1, NULL, NULL, NULL); |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
640 } |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
641 /* Fall back to the local machine if we didn't get the full name from the domain controller */ |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
642 else if (servername != NULL) { |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
643 /* purple_debug_info("bonjour", "Looking up the full name from the local machine"); */ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
645 if (info != NULL) NetApiBufferFree(info); |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
646 info = NULL; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
648 if (NetUserGetInfo(NULL, username, 10, &info) == NERR_Success |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
649 && info != NULL && ((LPUSER_INFO_10) info)->usri10_full_name != NULL |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
650 && *(((LPUSER_INFO_10) info)->usri10_full_name) != '\0') { |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
651 fullname = g_utf16_to_utf8( |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
652 ((LPUSER_INFO_10) info)->usri10_full_name, |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
653 -1, NULL, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
657 if (info != NULL) NetApiBufferFree(info); |
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
658 if (servername != NULL) NetApiBufferFree(servername); |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
659 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
660 if (!fullname) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
661 fullname = g_utf16_to_utf8(username, -1, NULL, NULL, NULL); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
662 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
663 |
20329
24ce4fcce5b0
applied changes from e56db1b8a7bb8729e30fb3bf99a94ff7887fe4ec
Luke Schierer <lschiere@pidgin.im>
parents:
20308
diff
changeset
|
664 purple_timeout_add(0, _set_default_name_cb, fullname); |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
665 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
666 return NULL; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
667 } |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
668 #endif |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
669 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
670 static void |
22007
c38d72677c8a
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@wiktel.com>
parents:
21829
diff
changeset
|
671 initialize_default_account_values(void) |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
672 { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
673 #ifndef _WIN32 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
674 struct passwd *info; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
675 #endif |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
676 const char *fullname = NULL, *splitpoint, *tmp; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
677 gchar *conv = NULL; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
678 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
679 #ifndef _WIN32 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
680 /* Try to figure out the user's real name */ |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
681 info = getpwuid(getuid()); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
682 if ((info != NULL) && (info->pw_gecos != NULL) && (info->pw_gecos[0] != '\0')) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
683 fullname = info->pw_gecos; |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
684 else if ((info != NULL) && (info->pw_name != NULL) && (info->pw_name[0] != '\0')) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
685 fullname = info->pw_name; |
19664
ccf627e2e0cc
We have got an empty fullname, set it to NULL so that we fall back to
Mark Doliner <mark@kingant.net>
parents:
19646
diff
changeset
|
686 else if (((fullname = getlogin()) != NULL) && (fullname[0] == '\0')) |
ccf627e2e0cc
We have got an empty fullname, set it to NULL so that we fall back to
Mark Doliner <mark@kingant.net>
parents:
19646
diff
changeset
|
687 fullname = NULL; |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
688 #else |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
689 /* The Win32 username lookup functions are synchronous so we do it in a thread */ |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
690 g_thread_create(_win32_name_lookup_thread, NULL, FALSE, NULL); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
691 #endif |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
692 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
693 /* Make sure fullname is valid UTF-8. If not, try to convert it. */ |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
694 if (fullname != NULL && !g_utf8_validate(fullname, -1, NULL)) { |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
695 fullname = conv = g_locale_to_utf8(fullname, -1, NULL, NULL, NULL); |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
696 if (conv == NULL || *conv == '\0') |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
697 fullname = NULL; |
18578
acd4ff9ddace
Bonjour only works on Windows2000 or newer, so we don't need to indirectly access the Net* functions. Avoid doing an unnecessary domain query to find the Domain Controller (which was causing a several second delay at startup). Also, try harder to avoid empty default names and falling back to "Purple Person".
Daniel Atallah <daniel.atallah@gmail.com>
parents:
17556
diff
changeset
|
698 } |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
699 |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
700 if (fullname == NULL) |
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
701 fullname = _("Purple Person"); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 /* Split the real name into a first and last name */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 splitpoint = strchr(fullname, ' '); |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
705 if (splitpoint != NULL) { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
706 default_firstname = g_strndup(fullname, splitpoint - fullname); |
16778
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
707 tmp = &splitpoint[1]; |
18843
7bf6b9a70b41
Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18578
diff
changeset
|
708 |
16778
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
709 /* The last name may be followed by a comma and additional data. |
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
710 * Only use the last name itself. |
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
711 */ |
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
712 splitpoint = strchr(tmp, ','); |
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
713 if (splitpoint != NULL) |
17495
d7b50cac1c7a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
16904
diff
changeset
|
714 default_lastname = g_strndup(tmp, splitpoint - tmp); |
16778
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
715 else |
a9975d6c2832
The last name from /etc/passwd may have additional comma-delimited data which we should ignore when determining the default Bonjour name. Fixes #477
Evan Schoenberg <evan.s@dreskin.net>
parents:
16719
diff
changeset
|
716 default_lastname = g_strdup(tmp); |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
717 } else { |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 default_firstname = g_strdup(fullname); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 default_lastname = g_strdup(""); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 |
19646
55d3f1622cf7
Lookup the default First and Last name values for bonjour on win32 in a thread to avoid delays when the plugin is being loaded. Apparently for some people the delay is quite significant when they're part of a domain, but the domain server isn't accessible.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19573
diff
changeset
|
722 g_free(conv); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
723 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
725 static void |
15822 | 726 init_plugin(PurplePlugin *plugin) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
727 { |
15822 | 728 PurpleAccountOption *option; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 initialize_default_account_values(); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
732 /* Creating the options for the protocol */ |
25497
f38799160cfa
Better support running many Bonjour clients on the same machine by allowing a
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24703
diff
changeset
|
733 option = purple_account_option_int_new(_("Local Port"), "port", BONJOUR_DEFAULT_PORT); |
f38799160cfa
Better support running many Bonjour clients on the same machine by allowing a
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24703
diff
changeset
|
734 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
f38799160cfa
Better support running many Bonjour clients on the same machine by allowing a
Daniel Atallah <daniel.atallah@gmail.com>
parents:
24703
diff
changeset
|
735 |
15822 | 736 option = purple_account_option_string_new(_("First name"), "first", default_firstname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
737 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
738 |
15822 | 739 option = purple_account_option_string_new(_("Last name"), "last", default_lastname); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
740 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 |
23180
e0bcb8cfda74
Use "email" and "Email" consistently. This is potentially controversial,
Richard Laager <rlaager@wiktel.com>
parents:
23170
diff
changeset
|
742 option = purple_account_option_string_new(_("Email"), "email", ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 |
15822 | 745 option = purple_account_option_string_new(_("AIM Account"), "AIM", ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 |
16904
56042b2f8b64
s/Jabber/XMPP in user-visible places.
Richard Laager <rlaager@wiktel.com>
parents:
16778
diff
changeset
|
748 option = purple_account_option_string_new(_("XMPP Account"), "jid", ""); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
749 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
750 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
751 my_protocol = plugin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 |
15822 | 754 PURPLE_INIT_PLUGIN(bonjour, init_plugin, info); |