8487
|
1 /*
|
|
2 * gaim - Rendezvous 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 "internal.h"
|
|
23
|
|
24 #include "account.h"
|
|
25 #include "accountopt.h"
|
|
26 #include "blist.h"
|
|
27 #include "conversation.h"
|
|
28 #include "debug.h"
|
|
29 #include "prpl.h"
|
|
30
|
|
31 #include "mdns.h"
|
|
32 #include "util.h"
|
|
33
|
|
34 #define RENDEZVOUS_CONNECT_STEPS 2
|
|
35
|
|
36 typedef struct _RendezvousData {
|
|
37 int fd;
|
|
38 GHashTable *buddies;
|
8629
|
39 GSList *mytxtdata;
|
8487
|
40 } RendezvousData;
|
|
41
|
|
42 typedef struct _RendezvousBuddy {
|
8612
|
43 #if 0
|
|
44 guint ttltimer;
|
|
45 #endif
|
8487
|
46 gchar *firstandlast;
|
|
47 gchar *aim;
|
|
48 int p2pjport;
|
|
49 int status;
|
|
50 int idle;
|
|
51 gchar *msg;
|
|
52 } RendezvousBuddy;
|
|
53
|
|
54 #define UC_IDLE 2
|
|
55
|
|
56 /****************************/
|
|
57 /* Utility Functions */
|
|
58 /****************************/
|
|
59 static void rendezvous_buddy_free(gpointer data)
|
|
60 {
|
|
61 RendezvousBuddy *rb = data;
|
|
62
|
|
63 g_free(rb->firstandlast);
|
|
64 g_free(rb->msg);
|
|
65 g_free(rb);
|
|
66 }
|
|
67
|
8546
|
68 /**
|
8487
|
69 * Extract the "user@host" name from a full presence domain
|
|
70 * of the form "user@host._presence._tcp.local"
|
|
71 *
|
|
72 * @return If the domain is NOT a _presence._tcp.local domain
|
|
73 * then return NULL. Otherwise return a newly allocated
|
|
74 * null-terminated string containing the "user@host" for
|
|
75 * the given domain. This string should be g_free'd
|
|
76 * when no longer needed.
|
|
77 */
|
|
78 static gchar *rendezvous_extract_name(gchar *domain)
|
|
79 {
|
|
80 gchar *ret, *suffix;
|
|
81
|
|
82 if (!g_str_has_suffix(domain, "._presence._tcp.local"))
|
|
83 return NULL;
|
|
84
|
|
85 suffix = strstr(domain, "._presence._tcp.local");
|
|
86 ret = g_strndup(domain, suffix - domain);
|
|
87
|
|
88 return ret;
|
|
89 }
|
|
90
|
|
91 /****************************/
|
|
92 /* Buddy List Functions */
|
|
93 /****************************/
|
8612
|
94
|
8487
|
95 static void rendezvous_addtolocal(GaimConnection *gc, const char *name, const char *domain)
|
|
96 {
|
|
97 GaimAccount *account = gaim_connection_get_account(gc);
|
|
98 GaimBuddy *b;
|
|
99 GaimGroup *g;
|
|
100
|
|
101 g = gaim_find_group(domain);
|
|
102 if (g == NULL) {
|
|
103 g = gaim_group_new(domain);
|
|
104 gaim_blist_add_group(g, NULL);
|
|
105 }
|
|
106
|
|
107 b = gaim_find_buddy_in_group(account, name, g);
|
|
108 if (b != NULL)
|
|
109 return;
|
|
110
|
|
111 b = gaim_buddy_new(account, name, NULL);
|
|
112 gaim_blist_add_buddy(b, NULL, g, NULL);
|
|
113 serv_got_update(gc, b->name, 1, 0, 0, 0, 0);
|
8612
|
114
|
|
115 #if 0
|
|
116 RendezvousBuddy *rb;
|
|
117 rb = g_hash_table_lookup(rd->buddies, name);
|
|
118 if (rb == NULL) {
|
|
119 rb = g_malloc0(sizeof(RendezvousBuddy));
|
|
120 g_hash_table_insert(rd->buddies, g_strdup(name), rb);
|
|
121 }
|
|
122 rb->ttltimer = gaim_timeout_add(time * 10000, rendezvous_buddy_timeout, gc);
|
|
123
|
|
124 gaim_timeout_remove(rb->ttltimer);
|
|
125 rb->ttltimer = 0;
|
|
126 #endif
|
8487
|
127 }
|
|
128
|
|
129 static void rendezvous_removefromlocal(GaimConnection *gc, const char *name, const char *domain)
|
|
130 {
|
|
131 GaimAccount *account = gaim_connection_get_account(gc);
|
|
132 GaimBuddy *b;
|
|
133 GaimGroup *g;
|
|
134
|
|
135 g = gaim_find_group(domain);
|
|
136 if (g == NULL)
|
|
137 return;
|
|
138
|
|
139 b = gaim_find_buddy_in_group(account, name, g);
|
|
140 if (b == NULL)
|
|
141 return;
|
|
142
|
|
143 serv_got_update(gc, b->name, 0, 0, 0, 0, 0);
|
|
144 gaim_blist_remove_buddy(b);
|
8546
|
145 /* XXX - This results in incorrect group counts--needs to be fixed in the core */
|
8612
|
146
|
|
147 /*
|
|
148 * XXX - Instead of removing immediately, wait 10 seconds and THEN remove
|
|
149 * them. If you do it immediately you don't see the door close icon.
|
|
150 */
|
8487
|
151 }
|
|
152
|
|
153 static void rendezvous_removeallfromlocal(GaimConnection *gc)
|
|
154 {
|
|
155 GaimAccount *account = gaim_connection_get_account(gc);
|
|
156 GaimBuddyList *blist;
|
|
157 GaimBlistNode *gnode, *cnode, *bnode;
|
|
158 GaimBuddy *b;
|
|
159
|
|
160 /* Go through and remove all buddies that belong to this account */
|
|
161 if ((blist = gaim_get_blist()) != NULL) {
|
|
162 for (gnode = blist->root; gnode; gnode = gnode->next) {
|
|
163 if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
|
|
164 continue;
|
|
165 for (cnode = gnode->child; cnode; cnode = cnode->next) {
|
|
166 if (!GAIM_BLIST_NODE_IS_CONTACT(cnode))
|
|
167 continue;
|
|
168 for (bnode = cnode->child; bnode; bnode = bnode->next) {
|
|
169 if (!GAIM_BLIST_NODE_IS_BUDDY(bnode))
|
|
170 continue;
|
|
171 b = (GaimBuddy *)bnode;
|
|
172 if (b->account != account)
|
|
173 continue;
|
|
174 serv_got_update(gc, b->name, 0, 0, 0, 0, 0);
|
|
175 gaim_blist_remove_buddy(b);
|
|
176 }
|
|
177 }
|
|
178 }
|
|
179 }
|
|
180 }
|
|
181
|
|
182 static void rendezvous_handle_rr_txt(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
|
|
183 {
|
|
184 RendezvousData *rd = gc->proto_data;
|
|
185 RendezvousBuddy *rb;
|
|
186 GHashTable *rdata;
|
|
187 gchar *tmp1, *tmp2;
|
|
188
|
8594
|
189 rdata = rr->rdata;
|
|
190
|
|
191 /* Don't do a damn thing if the version is greater than 1 */
|
|
192 tmp1 = g_hash_table_lookup(rdata, "version");
|
|
193 if ((tmp1 == NULL) || (strcmp(tmp1, "1")))
|
|
194 return;
|
|
195
|
8487
|
196 rb = g_hash_table_lookup(rd->buddies, name);
|
|
197 if (rb == NULL) {
|
|
198 rb = g_malloc0(sizeof(RendezvousBuddy));
|
|
199 g_hash_table_insert(rd->buddies, g_strdup(name), rb);
|
|
200 }
|
|
201
|
|
202 tmp1 = g_hash_table_lookup(rdata, "1st");
|
|
203 tmp2 = g_hash_table_lookup(rdata, "last");
|
|
204 g_free(rb->firstandlast);
|
|
205 rb->firstandlast = g_strdup_printf("%s%s%s",
|
|
206 (tmp1 ? tmp1 : ""),
|
|
207 (tmp1 || tmp2 ? " " : ""),
|
|
208 (tmp2 ? tmp2 : ""));
|
|
209 serv_got_alias(gc, name, rb->firstandlast);
|
|
210
|
|
211 tmp1 = g_hash_table_lookup(rdata, "aim");
|
|
212 if (tmp1 != NULL) {
|
|
213 g_free(rb->aim);
|
|
214 rb->aim = g_strdup(tmp1);
|
|
215 }
|
|
216
|
8594
|
217 /*
|
|
218 * We only want to use this port as a back-up. Ideally the port
|
|
219 * is specified in a separate, SRV resource record.
|
|
220 */
|
|
221 if (rb->p2pjport == 0) {
|
|
222 tmp1 = g_hash_table_lookup(rdata, "port.p2pj");
|
|
223 rb->p2pjport = atoi(tmp1);
|
|
224 }
|
8487
|
225
|
|
226 tmp1 = g_hash_table_lookup(rdata, "status");
|
|
227 if (tmp1 != NULL) {
|
8629
|
228 if (!strcmp(tmp1, "avail")) {
|
8487
|
229 /* Available */
|
|
230 rb->status = 0;
|
|
231 } else if (!strcmp(tmp1, "away")) {
|
|
232 /* Idle */
|
|
233 tmp2 = g_hash_table_lookup(rdata, "away");
|
|
234 rb->idle = atoi(tmp2);
|
8612
|
235 gaim_debug_error("XXX", "User has been idle since %d\n", rb->idle);
|
8487
|
236 rb->status = UC_IDLE;
|
8629
|
237 } else if (!strcmp(tmp1, "dnd")) {
|
8487
|
238 /* Away */
|
|
239 rb->status = UC_UNAVAILABLE;
|
|
240 }
|
|
241 serv_got_update(gc, name, 1, 0, 0, 0, rb->status);
|
|
242 }
|
|
243
|
|
244 tmp1 = g_hash_table_lookup(rdata, "msg");
|
|
245 if (tmp1 != NULL) {
|
|
246 g_free(rb->msg);
|
|
247 rb->msg = g_strdup(tmp1);
|
|
248 }
|
8594
|
249 }
|
8546
|
250
|
8594
|
251 static void rendezvous_handle_rr_srv(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
|
|
252 {
|
|
253 RendezvousData *rd = gc->proto_data;
|
|
254 RendezvousBuddy *rb;
|
|
255 ResourceRecordSRV *rdata;
|
|
256
|
|
257 rdata = rr->rdata;
|
|
258
|
|
259 rb = g_hash_table_lookup(rd->buddies, name);
|
|
260 if (rb == NULL) {
|
|
261 rb = g_malloc0(sizeof(RendezvousBuddy));
|
|
262 g_hash_table_insert(rd->buddies, g_strdup(name), rb);
|
|
263 }
|
|
264
|
|
265 rb->p2pjport = rdata->port;
|
8487
|
266 }
|
|
267
|
|
268 /*
|
|
269 * Parse a resource record and do stuff if we need to.
|
|
270 */
|
|
271 static void rendezvous_handle_rr(GaimConnection *gc, ResourceRecord *rr)
|
|
272 {
|
|
273 gchar *name;
|
|
274
|
8594
|
275 gaim_debug_misc("rendezvous", "Parsing resource record with domain name %s\n", rr->name);
|
|
276
|
|
277 /*
|
|
278 * XXX - Cache resource records from this function, if needed.
|
|
279 * Use the TTL value of the rr to cause this data to expire, but let
|
|
280 * the mdns_cache stuff handle that as much as possible.
|
|
281 */
|
8487
|
282
|
|
283 switch (rr->type) {
|
|
284 case RENDEZVOUS_RRTYPE_NULL: {
|
|
285 if ((name = rendezvous_extract_name(rr->name)) != NULL) {
|
|
286 if (rr->rdlength > 0) {
|
|
287 /* Data is a buddy icon */
|
|
288 gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc), name, rr->rdata, rr->rdlength);
|
|
289 }
|
|
290
|
|
291 g_free(name);
|
|
292 }
|
|
293 } break;
|
|
294
|
|
295 case RENDEZVOUS_RRTYPE_PTR: {
|
|
296 gchar *rdata = rr->rdata;
|
|
297 if ((name = rendezvous_extract_name(rdata)) != NULL) {
|
|
298 if (rr->ttl > 0)
|
|
299 rendezvous_addtolocal(gc, name, "Rendezvous");
|
|
300 else
|
|
301 rendezvous_removefromlocal(gc, name, "Rendezvous");
|
|
302 g_free(name);
|
|
303 }
|
|
304 } break;
|
|
305
|
|
306 case RENDEZVOUS_RRTYPE_TXT: {
|
|
307 if ((name = rendezvous_extract_name(rr->name)) != NULL) {
|
|
308 rendezvous_handle_rr_txt(gc, rr, name);
|
|
309 g_free(name);
|
|
310 }
|
|
311 } break;
|
8594
|
312
|
|
313 case RENDEZVOUS_RRTYPE_SRV: {
|
|
314 if ((name = rendezvous_extract_name(rr->name)) != NULL) {
|
|
315 rendezvous_handle_rr_srv(gc, rr, name);
|
|
316 g_free(name);
|
|
317 }
|
|
318 } break;
|
8487
|
319 }
|
|
320 }
|
|
321
|
|
322 /****************************/
|
|
323 /* Icon and Emblem Funtions */
|
|
324 /****************************/
|
|
325 static const char* rendezvous_prpl_list_icon(GaimAccount *a, GaimBuddy *b)
|
|
326 {
|
|
327 return "rendezvous";
|
|
328 }
|
|
329
|
|
330 static void rendezvous_prpl_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne)
|
|
331 {
|
|
332 if (GAIM_BUDDY_IS_ONLINE(b)) {
|
|
333 if (b->uc & UC_UNAVAILABLE)
|
|
334 *se = "away";
|
|
335 } else {
|
|
336 *se = "offline";
|
|
337 }
|
|
338 }
|
|
339
|
|
340 static gchar *rendezvous_prpl_status_text(GaimBuddy *b)
|
|
341 {
|
|
342 GaimConnection *gc = b->account->gc;
|
|
343 RendezvousData *rd = gc->proto_data;
|
|
344 RendezvousBuddy *rb;
|
|
345 gchar *ret;
|
|
346
|
|
347 rb = g_hash_table_lookup(rd->buddies, b->name);
|
|
348 if ((rb == NULL) || (rb->msg == NULL))
|
|
349 return NULL;
|
|
350
|
|
351 ret = g_strdup(rb->msg);
|
|
352
|
|
353 return ret;
|
|
354 }
|
|
355
|
|
356 static gchar *rendezvous_prpl_tooltip_text(GaimBuddy *b)
|
|
357 {
|
|
358 GaimConnection *gc = b->account->gc;
|
|
359 RendezvousData *rd = gc->proto_data;
|
|
360 RendezvousBuddy *rb;
|
|
361 GString *ret;
|
|
362
|
|
363 rb = g_hash_table_lookup(rd->buddies, b->name);
|
|
364 if (rb == NULL)
|
|
365 return NULL;
|
|
366
|
|
367 ret = g_string_new("");
|
|
368
|
|
369 if (rb->aim != NULL)
|
8591
|
370 g_string_append_printf(ret, "\n<b>%s</b>: %s", _("AIM Screen name"), rb->aim);
|
8487
|
371
|
|
372 if (rb->msg != NULL) {
|
|
373 if (rb->status == UC_UNAVAILABLE)
|
8591
|
374 g_string_append_printf(ret, "\n<b>%s</b>: %s", _("Away"), rb->msg);
|
8487
|
375 else
|
8591
|
376 g_string_append_printf(ret, "\n<b>%s</b>: %s", _("Available"), rb->msg);
|
8487
|
377 }
|
|
378
|
|
379 return g_string_free(ret, FALSE);
|
|
380 }
|
|
381
|
|
382 /****************************/
|
|
383 /* Connection Funtions */
|
|
384 /****************************/
|
|
385 static void rendezvous_callback(gpointer data, gint source, GaimInputCondition condition)
|
|
386 {
|
|
387 GaimConnection *gc = data;
|
|
388 RendezvousData *rd = gc->proto_data;
|
|
389 DNSPacket *dns;
|
|
390 int i;
|
|
391
|
|
392 gaim_debug_misc("rendezvous", "Received rendezvous datagram\n");
|
|
393
|
|
394 dns = mdns_read(rd->fd);
|
|
395 if (dns == NULL)
|
|
396 return;
|
|
397
|
|
398 /* Handle the DNS packet */
|
|
399 for (i = 0; i < dns->header.numanswers; i++)
|
|
400 rendezvous_handle_rr(gc, &dns->answers[i]);
|
|
401 for (i = 0; i < dns->header.numauthority; i++)
|
|
402 rendezvous_handle_rr(gc, &dns->authority[i]);
|
|
403 for (i = 0; i < dns->header.numadditional; i++)
|
|
404 rendezvous_handle_rr(gc, &dns->additional[i]);
|
|
405
|
|
406 mdns_free(dns);
|
|
407 }
|
|
408
|
8629
|
409 static void rendezvous_add_to_txt(RendezvousData *rd, const char *name, const char *value)
|
|
410 {
|
|
411 ResourceRecordTXTRDataNode *node;
|
|
412 node = g_malloc(sizeof(ResourceRecordTXTRDataNode));
|
|
413 node->name = g_strdup(name);
|
|
414 node->value = value != NULL ? g_strdup(value) : NULL;
|
|
415 rd->mytxtdata = g_slist_append(rd->mytxtdata, node);
|
|
416 }
|
|
417
|
|
418 static void rendezvous_send_online(GaimConnection *gc)
|
|
419 {
|
|
420 RendezvousData *rd = gc->proto_data;
|
|
421 GaimAccount *account = gaim_connection_get_account(gc);
|
|
422
|
|
423 mdns_advertise_ptr(rd->fd, "_presence._tcp.local", "mark@diverge._presence._tcp.local");
|
|
424
|
|
425 rendezvous_add_to_txt(rd, "txtvers", "1");
|
|
426 rendezvous_add_to_txt(rd, "status", "avail");
|
|
427 rendezvous_add_to_txt(rd, "1st", gaim_account_get_string(account, "first", "Gaim"));
|
|
428 rendezvous_add_to_txt(rd, "AIM", "markdoliner");
|
|
429 rendezvous_add_to_txt(rd, "version", "1");
|
|
430 rendezvous_add_to_txt(rd, "port.p2pj", "5298");
|
|
431 rendezvous_add_to_txt(rd, "last", gaim_account_get_string(account, "last", _("User")));
|
|
432 mdns_advertise_txt(rd->fd, "mark@diverge._presence._tcp.local", rd->mytxtdata);
|
|
433
|
|
434 #if 0
|
|
435 mdns_advertise_srv(rd->fd, "mark@diverge._presence._tcp.local", port 5298, IP?);
|
|
436 #endif
|
|
437 }
|
|
438
|
8487
|
439 static void rendezvous_prpl_login(GaimAccount *account)
|
|
440 {
|
|
441 GaimConnection *gc = gaim_account_get_connection(account);
|
|
442 RendezvousData *rd;
|
|
443
|
|
444 rd = g_new0(RendezvousData, 1);
|
|
445 rd->buddies = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, rendezvous_buddy_free);
|
|
446 gc->proto_data = rd;
|
|
447
|
|
448 gaim_connection_update_progress(gc, _("Preparing Buddy List"), 0, RENDEZVOUS_CONNECT_STEPS);
|
|
449 rendezvous_removeallfromlocal(gc);
|
|
450
|
|
451 gaim_connection_update_progress(gc, _("Connecting"), 1, RENDEZVOUS_CONNECT_STEPS);
|
|
452 rd->fd = mdns_establish_socket();
|
|
453 if (rd->fd == -1) {
|
|
454 gaim_connection_error(gc, _("Unable to login to rendezvous"));
|
|
455 return;
|
|
456 }
|
|
457
|
|
458 gc->inpa = gaim_input_add(rd->fd, GAIM_INPUT_READ, rendezvous_callback, gc);
|
|
459 gaim_connection_set_state(gc, GAIM_CONNECTED);
|
|
460
|
|
461 mdns_query(rd->fd, "_presence._tcp.local");
|
8629
|
462 rendezvous_send_online(gc);
|
8487
|
463 }
|
|
464
|
|
465 static void rendezvous_prpl_close(GaimConnection *gc)
|
|
466 {
|
|
467 RendezvousData *rd = (RendezvousData *)gc->proto_data;
|
8629
|
468 ResourceRecordTXTRDataNode *node;
|
8487
|
469
|
|
470 if (gc->inpa)
|
|
471 gaim_input_remove(gc->inpa);
|
|
472
|
|
473 rendezvous_removeallfromlocal(gc);
|
|
474
|
|
475 if (!rd)
|
|
476 return;
|
|
477
|
|
478 if (rd->fd >= 0)
|
|
479 close(rd->fd);
|
|
480
|
|
481 g_hash_table_destroy(rd->buddies);
|
|
482
|
8629
|
483 while (rd->mytxtdata != NULL) {
|
|
484 node = rd->mytxtdata->data;
|
|
485 rd->mytxtdata = g_slist_remove(rd->mytxtdata, node);
|
|
486 g_free(node->name);
|
|
487 g_free(node->value);
|
|
488 g_free(node);
|
|
489 }
|
|
490
|
8487
|
491 g_free(rd);
|
|
492 }
|
|
493
|
|
494 static int rendezvous_prpl_send_im(GaimConnection *gc, const char *who, const char *message, GaimConvImFlags flags)
|
|
495 {
|
|
496 gaim_debug_info("rendezvous", "Sending IM\n");
|
|
497
|
|
498 return 1;
|
|
499 }
|
|
500
|
8589
|
501 static void rendezvous_prpl_set_away(GaimConnection *gc, const char *state, const char *text)
|
8487
|
502 {
|
|
503 gaim_debug_error("rendezvous", "Set away, state=%s, text=%s\n", state, text);
|
|
504 }
|
|
505
|
|
506 static GaimPlugin *my_protocol = NULL;
|
|
507
|
|
508 static GaimPluginProtocolInfo prpl_info =
|
|
509 {
|
|
510 OPT_PROTO_NO_PASSWORD,
|
|
511 NULL,
|
|
512 NULL,
|
|
513 NULL,
|
|
514 rendezvous_prpl_list_icon,
|
|
515 rendezvous_prpl_list_emblems,
|
|
516 rendezvous_prpl_status_text,
|
|
517 rendezvous_prpl_tooltip_text,
|
|
518 NULL,
|
|
519 NULL,
|
|
520 NULL,
|
|
521 NULL,
|
|
522 rendezvous_prpl_login,
|
|
523 rendezvous_prpl_close,
|
|
524 rendezvous_prpl_send_im,
|
|
525 NULL,
|
|
526 NULL,
|
|
527 NULL,
|
8589
|
528 rendezvous_prpl_set_away,
|
8487
|
529 NULL,
|
|
530 NULL,
|
|
531 NULL,
|
|
532 NULL,
|
|
533 NULL,
|
|
534 NULL,
|
|
535 NULL,
|
|
536 NULL,
|
|
537 NULL,
|
|
538 NULL,
|
|
539 NULL,
|
|
540 NULL,
|
|
541 NULL,
|
|
542 NULL,
|
|
543 NULL,
|
|
544 NULL,
|
|
545 NULL,
|
|
546 NULL,
|
|
547 NULL,
|
|
548 NULL,
|
|
549 NULL,
|
|
550 NULL,
|
|
551 NULL,
|
|
552 NULL,
|
|
553 NULL,
|
|
554 NULL,
|
|
555 NULL,
|
|
556 NULL,
|
|
557 NULL,
|
|
558 NULL,
|
8586
|
559 NULL,
|
8589
|
560 NULL
|
8487
|
561 };
|
|
562
|
|
563 static GaimPluginInfo info =
|
|
564 {
|
|
565 2, /**< api_version */
|
|
566 GAIM_PLUGIN_PROTOCOL, /**< type */
|
|
567 NULL, /**< ui_requirement */
|
|
568 0, /**< flags */
|
|
569 NULL, /**< dependencies */
|
|
570 GAIM_PRIORITY_DEFAULT, /**< priority */
|
|
571
|
|
572 "prpl-rendezvous", /**< id */
|
|
573 "Rendezvous", /**< name */
|
|
574 VERSION, /**< version */
|
|
575 /** summary */
|
|
576 N_("Rendezvous Protocol Plugin"),
|
|
577 /** description */
|
|
578 N_("Rendezvous Protocol Plugin"),
|
|
579 NULL, /**< author */
|
|
580 GAIM_WEBSITE, /**< homepage */
|
|
581
|
|
582 NULL, /**< load */
|
|
583 NULL, /**< unload */
|
|
584 NULL, /**< destroy */
|
|
585
|
|
586 NULL, /**< ui_info */
|
|
587 &prpl_info /**< extra_info */
|
|
588 };
|
|
589
|
|
590 static void init_plugin(GaimPlugin *plugin)
|
|
591 {
|
|
592 GaimAccountUserSplit *split;
|
|
593 GaimAccountOption *option;
|
|
594
|
|
595 /* Try to avoid making this configurable... */
|
|
596 split = gaim_account_user_split_new(_("Host Name"), "localhost", '@');
|
|
597 prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
|
|
598
|
|
599 option = gaim_account_option_string_new(_("First Name"), "first", "Gaim");
|
|
600 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
|
|
601 option);
|
|
602
|
|
603 option = gaim_account_option_string_new(_("Last Name"), "last", _("User"));
|
|
604 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
|
|
605 option);
|
|
606
|
|
607 option = gaim_account_option_bool_new(_("Share AIM screen name"), "shareaim", TRUE);
|
|
608 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
|
|
609 option);
|
|
610
|
|
611 my_protocol = plugin;
|
|
612 }
|
|
613
|
|
614 GAIM_INIT_PLUGIN(rendezvous, init_plugin, info);
|