Mercurial > pidgin
comparison libpurple/protocols/bonjour/bonjour.c @ 15373:5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sat, 20 Jan 2007 02:32:10 +0000 |
parents | |
children | 21bc8d84974f |
comparison
equal
deleted
inserted
replaced
15372:f79e0f4df793 | 15373:5fe8042783c1 |
---|---|
1 /* | |
2 * gaim - Bonjour Protocol Plugin | |
3 * | |
4 * Gaim is the legal property of its developers, whose names are too numerous | |
5 * to list here. Please refer to the COPYRIGHT file distributed with this | |
6 * source distribution. | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 */ | |
22 #include <glib.h> | |
23 #ifndef _WIN32 | |
24 #include <pwd.h> | |
25 #else | |
26 #define UNICODE | |
27 #include <windows.h> | |
28 #include <lm.h> | |
29 #endif | |
30 | |
31 #include "internal.h" | |
32 | |
33 #include "account.h" | |
34 #include "accountopt.h" | |
35 #include "debug.h" | |
36 #include "util.h" | |
37 #include "version.h" | |
38 | |
39 #include "bonjour.h" | |
40 #include "dns_sd.h" | |
41 #include "jabber.h" | |
42 #include "buddy.h" | |
43 | |
44 /* | |
45 * TODO: Should implement an add_buddy callback that removes the buddy | |
46 * from the local list. Bonjour manages buddies for you, and | |
47 * adding someone locally by hand is stupid. Or, maybe even better, | |
48 * if a PRPL does not have an add_buddy callback then do not allow | |
49 * users to add buddies. | |
50 */ | |
51 | |
52 static char *default_firstname; | |
53 static char *default_lastname; | |
54 static char *default_hostname; | |
55 | |
56 static void | |
57 bonjour_removeallfromlocal(GaimConnection *gc) | |
58 { | |
59 GaimAccount *account = gaim_connection_get_account(gc); | |
60 GaimBuddyList *blist; | |
61 GaimBlistNode *gnode, *cnode, *bnode; | |
62 GaimBuddy *buddy; | |
63 | |
64 blist = gaim_get_blist(); | |
65 if (blist == NULL) | |
66 return; | |
67 | |
68 /* Go through and remove all buddies that belong to this account */ | |
69 for (gnode = blist->root; gnode; gnode = gnode->next) | |
70 { | |
71 if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
72 continue; | |
73 for (cnode = gnode->child; cnode; cnode = cnode->next) | |
74 { | |
75 if (!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
76 continue; | |
77 for (bnode = cnode->child; bnode; bnode = bnode->next) | |
78 { | |
79 if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
80 continue; | |
81 buddy = (GaimBuddy *)bnode; | |
82 if (buddy->account != account) | |
83 continue; | |
84 gaim_prpl_got_user_status(account, buddy->name, "offline", NULL); | |
85 gaim_blist_remove_buddy(buddy); | |
86 } | |
87 } | |
88 } | |
89 } | |
90 | |
91 static void | |
92 bonjour_login(GaimAccount *account) | |
93 { | |
94 GaimConnection *gc = gaim_account_get_connection(account); | |
95 GaimGroup *bonjour_group = NULL; | |
96 BonjourData *bd = NULL; | |
97 GaimStatus *status; | |
98 GaimPresence *presence; | |
99 | |
100 gc->flags |= GAIM_CONNECTION_HTML; | |
101 gc->proto_data = g_new0(BonjourData, 1); | |
102 bd = gc->proto_data; | |
103 | |
104 /* Start waiting for jabber connections (iChat style) */ | |
105 bd->jabber_data = g_new(BonjourJabber, 1); | |
106 bd->jabber_data->port = BONJOUR_DEFAULT_PORT_INT; | |
107 bd->jabber_data->account = account; | |
108 | |
109 if (bonjour_jabber_start(bd->jabber_data) == -1) { | |
110 /* Send a message about the connection error */ | |
111 gaim_connection_error(gc, _("Unable to listen for incoming IM connections\n")); | |
112 | |
113 /* Free the data */ | |
114 g_free(bd->jabber_data); | |
115 bd->jabber_data = NULL; | |
116 return; | |
117 } | |
118 | |
119 /* Connect to the mDNS daemon looking for buddies in the LAN */ | |
120 bd->dns_sd_data = bonjour_dns_sd_new(); | |
121 bd->dns_sd_data->name = (sw_string)gaim_account_get_username(account); | |
122 bd->dns_sd_data->txtvers = g_strdup("1"); | |
123 bd->dns_sd_data->version = g_strdup("1"); | |
124 bd->dns_sd_data->first = g_strdup(gaim_account_get_string(account, "first", default_firstname)); | |
125 bd->dns_sd_data->last = g_strdup(gaim_account_get_string(account, "last", default_lastname)); | |
126 bd->dns_sd_data->port_p2pj = bd->jabber_data->port; | |
127 bd->dns_sd_data->phsh = g_strdup(""); | |
128 bd->dns_sd_data->email = g_strdup(gaim_account_get_string(account, "email", "")); | |
129 bd->dns_sd_data->vc = g_strdup(""); | |
130 bd->dns_sd_data->jid = g_strdup(gaim_account_get_string(account, "jid", "")); | |
131 bd->dns_sd_data->AIM = g_strdup(gaim_account_get_string(account, "AIM", "")); | |
132 | |
133 status = gaim_account_get_active_status(account); | |
134 presence = gaim_account_get_presence(account); | |
135 if (gaim_presence_is_available(presence)) | |
136 bd->dns_sd_data->status = g_strdup("avail"); | |
137 else if (gaim_presence_is_idle(presence)) | |
138 bd->dns_sd_data->status = g_strdup("away"); | |
139 else | |
140 bd->dns_sd_data->status = g_strdup("dnd"); | |
141 bd->dns_sd_data->msg = g_strdup(gaim_status_get_attr_string(status, "message")); | |
142 | |
143 bd->dns_sd_data->account = account; | |
144 if (!bonjour_dns_sd_start(bd->dns_sd_data)) | |
145 { | |
146 gaim_connection_error(gc, _("Unable to establish connection with the local mDNS server. Is it running?")); | |
147 return; | |
148 } | |
149 | |
150 /* Create a group for bonjour buddies */ | |
151 bonjour_group = gaim_group_new(BONJOUR_GROUP_NAME); | |
152 gaim_blist_add_group(bonjour_group, NULL); | |
153 | |
154 /* Show the buddy list by telling Gaim we have already connected */ | |
155 gaim_connection_set_state(gc, GAIM_CONNECTED); | |
156 } | |
157 | |
158 static void | |
159 bonjour_close(GaimConnection *connection) | |
160 { | |
161 GaimGroup *bonjour_group; | |
162 BonjourData *bd = (BonjourData*)connection->proto_data; | |
163 | |
164 /* Stop looking for buddies in the LAN */ | |
165 if (bd->dns_sd_data != NULL) | |
166 { | |
167 bonjour_dns_sd_stop(bd->dns_sd_data); | |
168 bonjour_dns_sd_free(bd->dns_sd_data); | |
169 } | |
170 | |
171 if (bd->jabber_data != NULL) | |
172 { | |
173 /* Stop waiting for conversations */ | |
174 bonjour_jabber_stop(bd->jabber_data); | |
175 g_free(bd->jabber_data); | |
176 } | |
177 | |
178 /* Remove all the bonjour buddies */ | |
179 bonjour_removeallfromlocal(connection); | |
180 | |
181 /* Delete the bonjour group */ | |
182 bonjour_group = gaim_find_group(BONJOUR_GROUP_NAME); | |
183 if (bonjour_group != NULL) | |
184 gaim_blist_remove_group(bonjour_group); | |
185 | |
186 } | |
187 | |
188 static const char * | |
189 bonjour_list_icon(GaimAccount *account, GaimBuddy *buddy) | |
190 { | |
191 return BONJOUR_ICON_NAME; | |
192 } | |
193 | |
194 static int | |
195 bonjour_send_im(GaimConnection *connection, const char *to, const char *msg, GaimMessageFlags flags) | |
196 { | |
197 if(!to || !msg) | |
198 return 0; | |
199 | |
200 return bonjour_jabber_send_message(((BonjourData*)(connection->proto_data))->jabber_data, to, msg); | |
201 } | |
202 | |
203 static void | |
204 bonjour_set_status(GaimAccount *account, GaimStatus *status) | |
205 { | |
206 GaimConnection *gc; | |
207 BonjourData *bd; | |
208 gboolean disconnected; | |
209 GaimStatusType *type; | |
210 int primitive; | |
211 GaimPresence *presence; | |
212 const char *message, *bonjour_status; | |
213 gchar *stripped; | |
214 | |
215 gc = gaim_account_get_connection(account); | |
216 bd = gc->proto_data; | |
217 disconnected = gaim_account_is_disconnected(account); | |
218 type = gaim_status_get_type(status); | |
219 primitive = gaim_status_type_get_primitive(type); | |
220 presence = gaim_account_get_presence(account); | |
221 | |
222 message = gaim_status_get_attr_string(status, "message"); | |
223 if (message == NULL) | |
224 message = ""; | |
225 stripped = gaim_markup_strip_html(message); | |
226 | |
227 /* | |
228 * The three possible status for Bonjour are | |
229 * -available ("avail") | |
230 * -idle ("away") | |
231 * -away ("dnd") | |
232 * Each of them can have an optional message. | |
233 */ | |
234 if (gaim_presence_is_available(presence)) | |
235 bonjour_status = "avail"; | |
236 else if (gaim_presence_is_idle(presence)) | |
237 bonjour_status = "away"; | |
238 else | |
239 bonjour_status = "dnd"; | |
240 | |
241 bonjour_dns_sd_send_status(bd->dns_sd_data, bonjour_status, stripped); | |
242 g_free(stripped); | |
243 } | |
244 | |
245 static GList * | |
246 bonjour_status_types(GaimAccount *account) | |
247 { | |
248 GList *status_types = NULL; | |
249 GaimStatusType *type; | |
250 | |
251 g_return_val_if_fail(account != NULL, NULL); | |
252 | |
253 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, | |
254 BONJOUR_STATUS_ID_AVAILABLE, | |
255 NULL, TRUE, TRUE, FALSE, | |
256 "message", _("Message"), | |
257 gaim_value_new(GAIM_TYPE_STRING), NULL); | |
258 status_types = g_list_append(status_types, type); | |
259 | |
260 type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, | |
261 BONJOUR_STATUS_ID_AWAY, | |
262 NULL, TRUE, TRUE, FALSE, | |
263 "message", _("Message"), | |
264 gaim_value_new(GAIM_TYPE_STRING), NULL); | |
265 status_types = g_list_append(status_types, type); | |
266 | |
267 type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, | |
268 BONJOUR_STATUS_ID_OFFLINE, | |
269 NULL, TRUE, TRUE, FALSE); | |
270 status_types = g_list_append(status_types, type); | |
271 | |
272 return status_types; | |
273 } | |
274 | |
275 static void | |
276 bonjour_convo_closed(GaimConnection *connection, const char *who) | |
277 { | |
278 GaimBuddy *buddy = gaim_find_buddy(connection->account, who); | |
279 | |
280 if (buddy == NULL) | |
281 { | |
282 /* | |
283 * This buddy is not in our buddy list, and therefore does not really | |
284 * exist, so we won't have any data about them. | |
285 */ | |
286 return; | |
287 } | |
288 | |
289 bonjour_jabber_close_conversation(((BonjourData*)(connection->proto_data))->jabber_data, buddy); | |
290 } | |
291 | |
292 static void | |
293 bonjour_list_emblems(GaimBuddy *buddy, | |
294 const char **se, const char **sw, | |
295 const char **nw, const char **ne) | |
296 { | |
297 GaimPresence *presence; | |
298 | |
299 presence = gaim_buddy_get_presence(buddy); | |
300 | |
301 if (gaim_presence_is_online(presence) && !gaim_presence_is_available(presence)) | |
302 *se = "away"; | |
303 } | |
304 | |
305 static char * | |
306 bonjour_status_text(GaimBuddy *buddy) | |
307 { | |
308 GaimPresence *presence; | |
309 | |
310 presence = gaim_buddy_get_presence(buddy); | |
311 | |
312 if (gaim_presence_is_online(presence) && !gaim_presence_is_available(presence)) | |
313 return g_strdup("Away"); | |
314 | |
315 return NULL; | |
316 } | |
317 | |
318 static void | |
319 bonjour_tooltip_text(GaimBuddy *buddy, GaimNotifyUserInfo *user_info, gboolean full) | |
320 { | |
321 GaimPresence *presence; | |
322 GaimStatus *status; | |
323 const char *status_description; | |
324 const char *message; | |
325 | |
326 presence = gaim_buddy_get_presence(buddy); | |
327 status = gaim_presence_get_active_status(presence); | |
328 message = gaim_status_get_attr_string(status, "message"); | |
329 | |
330 if (gaim_presence_is_available(presence)) | |
331 status_description = gaim_status_get_name(status); | |
332 else if (gaim_presence_is_idle(presence)) | |
333 status_description = _("Idle"); | |
334 else | |
335 status_description = gaim_status_get_name(status); | |
336 | |
337 gaim_notify_user_info_add_pair(user_info, _("Status"), status_description); | |
338 if (message != NULL) | |
339 gaim_notify_user_info_add_pair(user_info, _("Message"), message); | |
340 } | |
341 | |
342 static gboolean | |
343 plugin_unload(GaimPlugin *plugin) | |
344 { | |
345 g_free(default_firstname); | |
346 g_free(default_lastname); | |
347 g_free(default_hostname); | |
348 | |
349 return TRUE; | |
350 } | |
351 | |
352 static GaimPlugin *my_protocol = NULL; | |
353 | |
354 static GaimPluginProtocolInfo prpl_info = | |
355 { | |
356 OPT_PROTO_NO_PASSWORD, | |
357 NULL, /* user_splits */ | |
358 NULL, /* protocol_options */ | |
359 /* {"png", 0, 0, 96, 96, 0, GAIM_ICON_SCALE_DISPLAY}, */ /* icon_spec */ | |
360 NO_BUDDY_ICONS, /* not yet */ /* icon_spec */ | |
361 bonjour_list_icon, /* list_icon */ | |
362 bonjour_list_emblems, /* list_emblems */ | |
363 bonjour_status_text, /* status_text */ | |
364 bonjour_tooltip_text, /* tooltip_text */ | |
365 bonjour_status_types, /* status_types */ | |
366 NULL, /* blist_node_menu */ | |
367 NULL, /* chat_info */ | |
368 NULL, /* chat_info_defaults */ | |
369 bonjour_login, /* login */ | |
370 bonjour_close, /* close */ | |
371 bonjour_send_im, /* send_im */ | |
372 NULL, /* set_info */ | |
373 NULL, /* send_typing */ | |
374 NULL, /* get_info */ | |
375 bonjour_set_status, /* set_status */ | |
376 NULL, /* set_idle */ | |
377 NULL, /* change_passwd */ | |
378 NULL, /* add_buddy */ | |
379 NULL, /* add_buddies */ | |
380 NULL, /* remove_buddy */ | |
381 NULL, /* remove_buddies */ | |
382 NULL, /* add_permit */ | |
383 NULL, /* add_deny */ | |
384 NULL, /* rem_permit */ | |
385 NULL, /* rem_deny */ | |
386 NULL, /* set_permit_deny */ | |
387 NULL, /* join_chat */ | |
388 NULL, /* reject_chat */ | |
389 NULL, /* get_chat_name */ | |
390 NULL, /* chat_invite */ | |
391 NULL, /* chat_leave */ | |
392 NULL, /* chat_whisper */ | |
393 NULL, /* chat_send */ | |
394 NULL, /* keepalive */ | |
395 NULL, /* register_user */ | |
396 NULL, /* get_cb_info */ | |
397 NULL, /* get_cb_away */ | |
398 NULL, /* alias_buddy */ | |
399 NULL, /* group_buddy */ | |
400 NULL, /* rename_group */ | |
401 NULL, /* buddy_free */ | |
402 bonjour_convo_closed, /* convo_closed */ | |
403 NULL, /* normalize */ | |
404 NULL, /* set_buddy_icon */ | |
405 NULL, /* remove_group */ | |
406 NULL, /* get_cb_real_name */ | |
407 NULL, /* set_chat_topic */ | |
408 NULL, /* find_blist_chat */ | |
409 NULL, /* roomlist_get_list */ | |
410 NULL, /* roomlist_cancel */ | |
411 NULL, /* roomlist_expand_category */ | |
412 NULL, /* can_receive_file */ | |
413 NULL, /* send_file */ | |
414 NULL, /* new_xfer */ | |
415 NULL, /* offline_message */ | |
416 NULL, /* whiteboard_prpl_ops */ | |
417 NULL, /* send_raw */ | |
418 NULL, /* roomlist_room_serialize */ | |
419 }; | |
420 | |
421 static GaimPluginInfo info = | |
422 { | |
423 GAIM_PLUGIN_MAGIC, | |
424 GAIM_MAJOR_VERSION, | |
425 GAIM_MINOR_VERSION, | |
426 GAIM_PLUGIN_PROTOCOL, /**< type */ | |
427 NULL, /**< ui_requirement */ | |
428 0, /**< flags */ | |
429 NULL, /**< dependencies */ | |
430 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
431 | |
432 "prpl-bonjour", /**< id */ | |
433 "Bonjour", /**< name */ | |
434 VERSION, /**< version */ | |
435 /** summary */ | |
436 N_("Bonjour Protocol Plugin"), | |
437 /** description */ | |
438 N_("Bonjour Protocol Plugin"), | |
439 NULL, /**< author */ | |
440 GAIM_WEBSITE, /**< homepage */ | |
441 | |
442 NULL, /**< load */ | |
443 plugin_unload, /**< unload */ | |
444 NULL, /**< destroy */ | |
445 | |
446 NULL, /**< ui_info */ | |
447 &prpl_info, /**< extra_info */ | |
448 NULL, /**< prefs_info */ | |
449 NULL | |
450 }; | |
451 | |
452 static void | |
453 initialize_default_account_values() | |
454 { | |
455 #ifdef _WIN32 | |
456 char *fullname = NULL; | |
457 #else | |
458 struct passwd *info; | |
459 const char *fullname = NULL; | |
460 #endif | |
461 char *splitpoint = NULL; | |
462 char hostname[255]; | |
463 | |
464 #ifndef _WIN32 | |
465 /* Try to figure out the user's real name */ | |
466 info = getpwuid(getuid()); | |
467 if ((info != NULL) && (info->pw_gecos != NULL) && (info->pw_gecos[0] != '\0')) | |
468 fullname = info->pw_gecos; | |
469 else if ((info != NULL) && (info->pw_name != NULL) && (info->pw_name[0] != '\0')) | |
470 fullname = info->pw_name; | |
471 else if (((fullname = getlogin()) != NULL) && (fullname[0] != '\0')) | |
472 ; | |
473 else | |
474 fullname = _("Gaim User"); | |
475 | |
476 /* Make sure fullname is valid UTF-8. If not, try to convert it. */ | |
477 if (!g_utf8_validate(fullname, -1, NULL)) | |
478 { | |
479 gchar *tmp; | |
480 tmp = g_locale_to_utf8(fullname, -1, NULL, NULL, NULL); | |
481 if ((tmp == NULL) || (*tmp == '\0')) | |
482 fullname = _("Gaim User"); | |
483 } | |
484 | |
485 #else | |
486 FARPROC myNetUserGetInfo = wgaim_find_and_loadproc("Netapi32.dll", | |
487 "NetUserGetInfo"); | |
488 | |
489 if (myNetUserGetInfo) { | |
490 LPUSER_INFO_10 user_info = NULL; | |
491 LPSERVER_INFO_100 server_info = NULL; | |
492 wchar_t *servername = NULL; | |
493 wchar_t username[UNLEN + 1] = {'\0'}; | |
494 DWORD dwLenUsername = sizeof(username); | |
495 FARPROC myNetServerEnum = wgaim_find_and_loadproc( | |
496 "Netapi32.dll", "NetServerEnum"); | |
497 FARPROC myNetApiBufferFree = wgaim_find_and_loadproc( | |
498 "Netapi32.dll", "NetApiBufferFree"); | |
499 | |
500 if (myNetServerEnum && myNetApiBufferFree) { | |
501 DWORD dwEntriesRead = 0; | |
502 DWORD dwTotalEntries = 0; | |
503 DWORD dwResumeHandle = 0; | |
504 | |
505 NET_API_STATUS nStatus = (myNetServerEnum)(NULL, 100, | |
506 &server_info, MAX_PREFERRED_LENGTH, | |
507 &dwEntriesRead, &dwTotalEntries, | |
508 SV_TYPE_DOMAIN_CTRL, NULL, &dwResumeHandle); | |
509 | |
510 if ((nStatus == NERR_Success | |
511 || nStatus == ERROR_MORE_DATA) | |
512 && dwEntriesRead > 0) { | |
513 servername = server_info->sv100_name; | |
514 } else { | |
515 gaim_debug_warning("bonjour", "Unable to look up domain controller. NET_API_STATUS = %d, Entries Read = %d, Total Entries = %d\n", nStatus, dwEntriesRead, dwTotalEntries); | |
516 } | |
517 } | |
518 | |
519 if (!GetUserNameW(&username, &dwLenUsername)) { | |
520 gaim_debug_warning("bonjour", | |
521 "Unable to look up username\n"); | |
522 } | |
523 | |
524 if (username != NULL && *username != '\0' | |
525 && (myNetUserGetInfo)(servername, username, 10, | |
526 &user_info) == NERR_Success) { | |
527 if (user_info != NULL) { | |
528 fullname = g_utf16_to_utf8( | |
529 user_info->usri10_full_name, | |
530 -1, NULL, NULL, NULL); | |
531 } | |
532 } | |
533 if (user_info != NULL) | |
534 (myNetApiBufferFree)(user_info); | |
535 if (server_info != NULL) | |
536 (myNetApiBufferFree)(server_info); | |
537 } | |
538 | |
539 if (!fullname) | |
540 fullname = g_strdup(_("Gaim User")); | |
541 #endif | |
542 | |
543 /* Split the real name into a first and last name */ | |
544 splitpoint = strchr(fullname, ' '); | |
545 if (splitpoint != NULL) | |
546 { | |
547 default_firstname = g_strndup(fullname, splitpoint - fullname); | |
548 default_lastname = g_strdup(&splitpoint[1]); | |
549 } | |
550 else | |
551 { | |
552 default_firstname = g_strdup(fullname); | |
553 default_lastname = g_strdup(""); | |
554 } | |
555 | |
556 #ifdef _WIN32 | |
557 g_free(fullname); | |
558 #endif | |
559 | |
560 /* Try to figure out a good host name to use */ | |
561 /* TODO: Avoid 'localhost,' if possible */ | |
562 if (gethostname(hostname, 255) != 0) { | |
563 gaim_debug_warning("bonjour", "Error %d when getting host name. Using \"localhost.\"\n", errno); | |
564 strcpy(hostname, "localhost"); | |
565 } | |
566 default_hostname = g_strdup(hostname); | |
567 } | |
568 | |
569 static void | |
570 init_plugin(GaimPlugin *plugin) | |
571 { | |
572 GaimAccountUserSplit *split; | |
573 GaimAccountOption *option; | |
574 | |
575 initialize_default_account_values(); | |
576 | |
577 /* Creating the user splits */ | |
578 split = gaim_account_user_split_new(_("Hostname"), default_hostname, '@'); | |
579 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); | |
580 | |
581 /* Creating the options for the protocol */ | |
582 option = gaim_account_option_string_new(_("First name"), "first", default_firstname); | |
583 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
584 | |
585 option = gaim_account_option_string_new(_("Last name"), "last", default_lastname); | |
586 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
587 | |
588 option = gaim_account_option_string_new(_("E-mail"), "email", ""); | |
589 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
590 | |
591 option = gaim_account_option_string_new(_("AIM Account"), "AIM", ""); | |
592 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
593 | |
594 option = gaim_account_option_string_new(_("Jabber Account"), "jid", ""); | |
595 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | |
596 | |
597 my_protocol = plugin; | |
598 } | |
599 | |
600 GAIM_INIT_PLUGIN(bonjour, init_plugin, info); |