Mon, 05 Apr 2004 20:42:13 +0000
[gaim-migrate @ 9336]
Another patch from Pekka Riikonen, this one implementing a prpl-specific
blist chat menu similar to the prpl-specific blist buddy menu. I also
took the liberty of filling out the prpl callback structures with NULL
entries for those which were short -- not that it matters, but it soothes
my sense of aesthetics.
committer: Ethan Blanton <elb@pidgin.im>
| 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; | |
| 39 | } RendezvousData; | |
| 40 | ||
| 41 | typedef struct _RendezvousBuddy { | |
| 42 | gchar *firstandlast; | |
| 43 | gchar *aim; | |
| 44 | int p2pjport; | |
| 45 | int status; | |
| 46 | int idle; | |
| 47 | gchar *msg; | |
| 48 | } RendezvousBuddy; | |
| 49 | ||
| 50 | #define UC_IDLE 2 | |
| 51 | ||
| 52 | /****************************/ | |
| 53 | /* Utility Functions */ | |
| 54 | /****************************/ | |
| 55 | static void rendezvous_buddy_free(gpointer data) | |
| 56 | { | |
| 57 | RendezvousBuddy *rb = data; | |
| 58 | ||
| 59 | g_free(rb->firstandlast); | |
| 60 | g_free(rb->msg); | |
| 61 | g_free(rb); | |
| 62 | } | |
| 63 | ||
|
8546
59e40a3b08bf
[gaim-migrate @ 9288]
Mark Doliner <markdoliner@pidgin.im>
parents:
8489
diff
changeset
|
64 | /** |
| 8487 | 65 | * Extract the "user@host" name from a full presence domain |
| 66 | * of the form "user@host._presence._tcp.local" | |
| 67 | * | |
| 68 | * @return If the domain is NOT a _presence._tcp.local domain | |
| 69 | * then return NULL. Otherwise return a newly allocated | |
| 70 | * null-terminated string containing the "user@host" for | |
| 71 | * the given domain. This string should be g_free'd | |
| 72 | * when no longer needed. | |
| 73 | */ | |
| 74 | static gchar *rendezvous_extract_name(gchar *domain) | |
| 75 | { | |
| 76 | gchar *ret, *suffix; | |
| 77 | ||
| 78 | if (!g_str_has_suffix(domain, "._presence._tcp.local")) | |
| 79 | return NULL; | |
| 80 | ||
| 81 | suffix = strstr(domain, "._presence._tcp.local"); | |
| 82 | ret = g_strndup(domain, suffix - domain); | |
| 83 | ||
| 84 | return ret; | |
| 85 | } | |
| 86 | ||
| 87 | /****************************/ | |
| 88 | /* Buddy List Functions */ | |
| 89 | /****************************/ | |
| 90 | static void rendezvous_addtolocal(GaimConnection *gc, const char *name, const char *domain) | |
| 91 | { | |
| 92 | GaimAccount *account = gaim_connection_get_account(gc); | |
| 93 | GaimBuddy *b; | |
| 94 | GaimGroup *g; | |
| 95 | ||
| 96 | g = gaim_find_group(domain); | |
| 97 | if (g == NULL) { | |
| 98 | g = gaim_group_new(domain); | |
| 99 | gaim_blist_add_group(g, NULL); | |
| 100 | } | |
| 101 | ||
| 102 | b = gaim_find_buddy_in_group(account, name, g); | |
| 103 | if (b != NULL) | |
| 104 | return; | |
| 105 | ||
| 106 | b = gaim_buddy_new(account, name, NULL); | |
| 107 | gaim_blist_add_buddy(b, NULL, g, NULL); | |
| 108 | serv_got_update(gc, b->name, 1, 0, 0, 0, 0); | |
| 109 | } | |
| 110 | ||
| 111 | static void rendezvous_removefromlocal(GaimConnection *gc, const char *name, const char *domain) | |
| 112 | { | |
| 113 | GaimAccount *account = gaim_connection_get_account(gc); | |
| 114 | GaimBuddy *b; | |
| 115 | GaimGroup *g; | |
| 116 | ||
| 117 | g = gaim_find_group(domain); | |
| 118 | if (g == NULL) | |
| 119 | return; | |
| 120 | ||
| 121 | b = gaim_find_buddy_in_group(account, name, g); | |
| 122 | if (b == NULL) | |
| 123 | return; | |
| 124 | ||
| 125 | serv_got_update(gc, b->name, 0, 0, 0, 0, 0); | |
| 126 | gaim_blist_remove_buddy(b); | |
|
8546
59e40a3b08bf
[gaim-migrate @ 9288]
Mark Doliner <markdoliner@pidgin.im>
parents:
8489
diff
changeset
|
127 | /* XXX - This results in incorrect group counts--needs to be fixed in the core */ |
| 8487 | 128 | } |
| 129 | ||
| 130 | static void rendezvous_removeallfromlocal(GaimConnection *gc) | |
| 131 | { | |
| 132 | GaimAccount *account = gaim_connection_get_account(gc); | |
| 133 | GaimBuddyList *blist; | |
| 134 | GaimBlistNode *gnode, *cnode, *bnode; | |
| 135 | GaimBuddy *b; | |
| 136 | ||
| 137 | /* Go through and remove all buddies that belong to this account */ | |
| 138 | if ((blist = gaim_get_blist()) != NULL) { | |
| 139 | for (gnode = blist->root; gnode; gnode = gnode->next) { | |
| 140 | if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
| 141 | continue; | |
| 142 | for (cnode = gnode->child; cnode; cnode = cnode->next) { | |
| 143 | if (!GAIM_BLIST_NODE_IS_CONTACT(cnode)) | |
| 144 | continue; | |
| 145 | for (bnode = cnode->child; bnode; bnode = bnode->next) { | |
| 146 | if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) | |
| 147 | continue; | |
| 148 | b = (GaimBuddy *)bnode; | |
| 149 | if (b->account != account) | |
| 150 | continue; | |
| 151 | serv_got_update(gc, b->name, 0, 0, 0, 0, 0); | |
| 152 | gaim_blist_remove_buddy(b); | |
| 153 | } | |
| 154 | } | |
| 155 | } | |
| 156 | } | |
| 157 | } | |
| 158 | ||
| 159 | static void rendezvous_handle_rr_txt(GaimConnection *gc, ResourceRecord *rr, const gchar *name) | |
| 160 | { | |
| 161 | RendezvousData *rd = gc->proto_data; | |
| 162 | RendezvousBuddy *rb; | |
| 163 | GHashTable *rdata; | |
| 164 | gchar *tmp1, *tmp2; | |
| 165 | ||
| 166 | rb = g_hash_table_lookup(rd->buddies, name); | |
| 167 | if (rb == NULL) { | |
| 168 | rb = g_malloc0(sizeof(RendezvousBuddy)); | |
| 169 | g_hash_table_insert(rd->buddies, g_strdup(name), rb); | |
| 170 | } | |
| 171 | ||
| 172 | rdata = rr->rdata; | |
| 173 | ||
| 174 | tmp1 = g_hash_table_lookup(rdata, "1st"); | |
| 175 | tmp2 = g_hash_table_lookup(rdata, "last"); | |
| 176 | g_free(rb->firstandlast); | |
| 177 | rb->firstandlast = g_strdup_printf("%s%s%s", | |
| 178 | (tmp1 ? tmp1 : ""), | |
| 179 | (tmp1 || tmp2 ? " " : ""), | |
| 180 | (tmp2 ? tmp2 : "")); | |
| 181 | serv_got_alias(gc, name, rb->firstandlast); | |
| 182 | ||
| 183 | tmp1 = g_hash_table_lookup(rdata, "aim"); | |
| 184 | if (tmp1 != NULL) { | |
| 185 | g_free(rb->aim); | |
| 186 | rb->aim = g_strdup(tmp1); | |
| 187 | } | |
| 188 | ||
| 189 | tmp1 = g_hash_table_lookup(rdata, "port.p2pj"); | |
| 190 | rb->p2pjport = atoi(tmp1); | |
| 191 | ||
| 192 | tmp1 = g_hash_table_lookup(rdata, "status"); | |
| 193 | if (tmp1 != NULL) { | |
| 194 | if (!strcmp(tmp1, "dnd")) { | |
| 195 | /* Available */ | |
| 196 | rb->status = 0; | |
| 197 | } else if (!strcmp(tmp1, "away")) { | |
| 198 | /* Idle */ | |
| 199 | tmp2 = g_hash_table_lookup(rdata, "away"); | |
| 200 | rb->idle = atoi(tmp2); | |
| 201 | gaim_debug_error("XXX", "User has been idle for %d\n", rb->idle); | |
| 202 | rb->status = UC_IDLE; | |
| 203 | } else if (!strcmp(tmp1, "avail")) { | |
| 204 | /* Away */ | |
| 205 | rb->status = UC_UNAVAILABLE; | |
| 206 | } | |
| 207 | serv_got_update(gc, name, 1, 0, 0, 0, rb->status); | |
| 208 | } | |
| 209 | ||
| 210 | tmp1 = g_hash_table_lookup(rdata, "msg"); | |
| 211 | if (tmp1 != NULL) { | |
| 212 | g_free(rb->msg); | |
| 213 | rb->msg = g_strdup(tmp1); | |
| 214 | } | |
|
8546
59e40a3b08bf
[gaim-migrate @ 9288]
Mark Doliner <markdoliner@pidgin.im>
parents:
8489
diff
changeset
|
215 | |
|
59e40a3b08bf
[gaim-migrate @ 9288]
Mark Doliner <markdoliner@pidgin.im>
parents:
8489
diff
changeset
|
216 | /* XXX - Use the TTL value of the rr to cause this data to expire */ |
| 8487 | 217 | } |
| 218 | ||
| 219 | /* | |
| 220 | * Parse a resource record and do stuff if we need to. | |
| 221 | */ | |
| 222 | static void rendezvous_handle_rr(GaimConnection *gc, ResourceRecord *rr) | |
| 223 | { | |
| 224 | gchar *name; | |
| 225 | ||
| 226 | gaim_debug_error("XXX", "Parsing resource record with domain name %s\n", rr->name); | |
| 227 | ||
| 228 | switch (rr->type) { | |
| 229 | case RENDEZVOUS_RRTYPE_NULL: { | |
| 230 | if ((name = rendezvous_extract_name(rr->name)) != NULL) { | |
| 231 | if (rr->rdlength > 0) { | |
| 232 | /* Data is a buddy icon */ | |
| 233 | gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc), name, rr->rdata, rr->rdlength); | |
| 234 | } | |
| 235 | ||
| 236 | g_free(name); | |
| 237 | } | |
| 238 | } break; | |
| 239 | ||
| 240 | case RENDEZVOUS_RRTYPE_PTR: { | |
| 241 | gchar *rdata = rr->rdata; | |
| 242 | if ((name = rendezvous_extract_name(rdata)) != NULL) { | |
| 243 | if (rr->ttl > 0) | |
| 244 | rendezvous_addtolocal(gc, name, "Rendezvous"); | |
| 245 | else | |
| 246 | rendezvous_removefromlocal(gc, name, "Rendezvous"); | |
| 247 | ||
| 248 | g_free(name); | |
| 249 | } | |
| 250 | } break; | |
| 251 | ||
| 252 | case RENDEZVOUS_RRTYPE_TXT: { | |
| 253 | if ((name = rendezvous_extract_name(rr->name)) != NULL) { | |
| 254 | rendezvous_handle_rr_txt(gc, rr, name); | |
| 255 | g_free(name); | |
| 256 | } | |
| 257 | } break; | |
| 258 | } | |
| 259 | } | |
| 260 | ||
| 261 | /****************************/ | |
| 262 | /* Icon and Emblem Funtions */ | |
| 263 | /****************************/ | |
| 264 | static const char* rendezvous_prpl_list_icon(GaimAccount *a, GaimBuddy *b) | |
| 265 | { | |
| 266 | return "rendezvous"; | |
| 267 | } | |
| 268 | ||
| 269 | static void rendezvous_prpl_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne) | |
| 270 | { | |
| 271 | if (GAIM_BUDDY_IS_ONLINE(b)) { | |
| 272 | if (b->uc & UC_UNAVAILABLE) | |
| 273 | *se = "away"; | |
| 274 | } else { | |
| 275 | *se = "offline"; | |
| 276 | } | |
| 277 | } | |
| 278 | ||
| 279 | static gchar *rendezvous_prpl_status_text(GaimBuddy *b) | |
| 280 | { | |
| 281 | GaimConnection *gc = b->account->gc; | |
| 282 | RendezvousData *rd = gc->proto_data; | |
| 283 | RendezvousBuddy *rb; | |
| 284 | gchar *ret; | |
| 285 | ||
| 286 | rb = g_hash_table_lookup(rd->buddies, b->name); | |
| 287 | if ((rb == NULL) || (rb->msg == NULL)) | |
| 288 | return NULL; | |
| 289 | ||
| 290 | ret = g_strdup(rb->msg); | |
| 291 | ||
| 292 | return ret; | |
| 293 | } | |
| 294 | ||
| 295 | static gchar *rendezvous_prpl_tooltip_text(GaimBuddy *b) | |
| 296 | { | |
| 297 | GaimConnection *gc = b->account->gc; | |
| 298 | RendezvousData *rd = gc->proto_data; | |
| 299 | RendezvousBuddy *rb; | |
| 300 | GString *ret; | |
| 301 | ||
| 302 | rb = g_hash_table_lookup(rd->buddies, b->name); | |
| 303 | if (rb == NULL) | |
| 304 | return NULL; | |
| 305 | ||
| 306 | ret = g_string_new(""); | |
| 307 | ||
| 308 | if (rb->aim != NULL) | |
| 309 | g_string_append_printf(ret, _("<b>AIM Screen name</b>: %s\n"), rb->aim); | |
| 310 | ||
| 311 | if (rb->msg != NULL) { | |
| 312 | if (rb->status == UC_UNAVAILABLE) | |
|
8489
7d4b18aa1eb7
[gaim-migrate @ 9224]
Mark Doliner <markdoliner@pidgin.im>
parents:
8487
diff
changeset
|
313 | g_string_append_printf(ret, _("<b>Away</b>: %s\n"), rb->msg); |
| 8487 | 314 | else |
|
8489
7d4b18aa1eb7
[gaim-migrate @ 9224]
Mark Doliner <markdoliner@pidgin.im>
parents:
8487
diff
changeset
|
315 | g_string_append_printf(ret, _("<b>Available</b>: %s\n"), rb->msg); |
| 8487 | 316 | } |
| 317 | ||
| 318 | /* XXX - Fix blist.c so we can prepend the \n's rather than appending them */ | |
| 319 | ||
| 320 | return g_string_free(ret, FALSE); | |
| 321 | } | |
| 322 | ||
| 323 | /****************************/ | |
| 324 | /* Connection Funtions */ | |
| 325 | /****************************/ | |
| 326 | static void rendezvous_callback(gpointer data, gint source, GaimInputCondition condition) | |
| 327 | { | |
| 328 | GaimConnection *gc = data; | |
| 329 | RendezvousData *rd = gc->proto_data; | |
| 330 | DNSPacket *dns; | |
| 331 | int i; | |
| 332 | ||
| 333 | gaim_debug_misc("rendezvous", "Received rendezvous datagram\n"); | |
| 334 | ||
| 335 | dns = mdns_read(rd->fd); | |
| 336 | if (dns == NULL) | |
| 337 | return; | |
| 338 | ||
| 339 | /* Handle the DNS packet */ | |
| 340 | for (i = 0; i < dns->header.numanswers; i++) | |
| 341 | rendezvous_handle_rr(gc, &dns->answers[i]); | |
| 342 | for (i = 0; i < dns->header.numauthority; i++) | |
| 343 | rendezvous_handle_rr(gc, &dns->authority[i]); | |
| 344 | for (i = 0; i < dns->header.numadditional; i++) | |
| 345 | rendezvous_handle_rr(gc, &dns->additional[i]); | |
| 346 | ||
| 347 | mdns_free(dns); | |
| 348 | } | |
| 349 | ||
| 350 | static void rendezvous_prpl_login(GaimAccount *account) | |
| 351 | { | |
| 352 | GaimConnection *gc = gaim_account_get_connection(account); | |
| 353 | RendezvousData *rd; | |
| 354 | ||
| 355 | rd = g_new0(RendezvousData, 1); | |
| 356 | rd->buddies = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, rendezvous_buddy_free); | |
| 357 | gc->proto_data = rd; | |
| 358 | ||
| 359 | gaim_connection_update_progress(gc, _("Preparing Buddy List"), 0, RENDEZVOUS_CONNECT_STEPS); | |
| 360 | rendezvous_removeallfromlocal(gc); | |
| 361 | ||
| 362 | gaim_connection_update_progress(gc, _("Connecting"), 1, RENDEZVOUS_CONNECT_STEPS); | |
| 363 | rd->fd = mdns_establish_socket(); | |
| 364 | if (rd->fd == -1) { | |
| 365 | gaim_connection_error(gc, _("Unable to login to rendezvous")); | |
| 366 | return; | |
| 367 | } | |
| 368 | ||
| 369 | gc->inpa = gaim_input_add(rd->fd, GAIM_INPUT_READ, rendezvous_callback, gc); | |
| 370 | gaim_connection_set_state(gc, GAIM_CONNECTED); | |
| 371 | ||
| 372 | mdns_query(rd->fd, "_presence._tcp.local"); | |
| 373 | ||
| 374 | #if 0 | |
| 375 | text_record_add("txtvers", "1"); | |
| 376 | text_record_add("status", "avail"); | |
| 377 | text_record_add("1st", gaim_account_get_string(account, "first", "Gaim")); | |
| 378 | text_record_add("AIM", "markdoliner"); | |
| 379 | text_record_add("version", "1"); | |
| 380 | text_record_add("port.p2pj", "5298"); | |
| 381 | text_record_add("last", gaim_account_get_string(account, "last", _("User"))); | |
| 382 | ||
| 383 | publish(account->username, "_presence._tcp", 5298); | |
| 384 | #endif | |
| 385 | } | |
| 386 | ||
| 387 | static void rendezvous_prpl_close(GaimConnection *gc) | |
| 388 | { | |
| 389 | RendezvousData *rd = (RendezvousData *)gc->proto_data; | |
| 390 | ||
| 391 | if (gc->inpa) | |
| 392 | gaim_input_remove(gc->inpa); | |
| 393 | ||
| 394 | rendezvous_removeallfromlocal(gc); | |
| 395 | ||
| 396 | if (!rd) | |
| 397 | return; | |
| 398 | ||
| 399 | if (rd->fd >= 0) | |
| 400 | close(rd->fd); | |
| 401 | ||
| 402 | g_hash_table_destroy(rd->buddies); | |
| 403 | ||
| 404 | g_free(rd); | |
| 405 | } | |
| 406 | ||
| 407 | static int rendezvous_prpl_send_im(GaimConnection *gc, const char *who, const char *message, GaimConvImFlags flags) | |
| 408 | { | |
| 409 | gaim_debug_info("rendezvous", "Sending IM\n"); | |
| 410 | ||
| 411 | return 1; | |
| 412 | } | |
| 413 | ||
| 414 | static void rendezvous_prpl_setaway(GaimConnection *gc, const char *state, const char *text) | |
| 415 | { | |
| 416 | gaim_debug_error("rendezvous", "Set away, state=%s, text=%s\n", state, text); | |
| 417 | } | |
| 418 | ||
| 419 | static GaimPlugin *my_protocol = NULL; | |
| 420 | ||
| 421 | static GaimPluginProtocolInfo prpl_info = | |
| 422 | { | |
| 423 | OPT_PROTO_NO_PASSWORD, | |
| 424 | NULL, | |
| 425 | NULL, | |
| 426 | NULL, | |
| 427 | rendezvous_prpl_list_icon, | |
| 428 | rendezvous_prpl_list_emblems, | |
| 429 | rendezvous_prpl_status_text, | |
| 430 | rendezvous_prpl_tooltip_text, | |
| 431 | NULL, | |
| 432 | NULL, | |
| 433 | NULL, | |
| 434 | NULL, | |
| 435 | rendezvous_prpl_login, | |
| 436 | rendezvous_prpl_close, | |
| 437 | rendezvous_prpl_send_im, | |
| 438 | NULL, | |
| 439 | NULL, | |
| 440 | NULL, | |
| 441 | rendezvous_prpl_setaway, | |
| 442 | NULL, | |
| 443 | NULL, | |
| 444 | NULL, | |
| 445 | NULL, | |
| 446 | NULL, | |
| 447 | NULL, | |
| 448 | NULL, | |
| 449 | NULL, | |
| 450 | NULL, | |
| 451 | NULL, | |
| 452 | NULL, | |
| 453 | NULL, | |
| 454 | NULL, | |
| 455 | NULL, | |
| 456 | NULL, | |
| 457 | NULL, | |
| 458 | NULL, | |
| 459 | NULL, | |
| 460 | NULL, | |
| 461 | NULL, | |
| 462 | NULL, | |
| 463 | NULL, | |
| 464 | NULL, | |
| 465 | NULL, | |
| 466 | NULL, | |
| 467 | NULL, | |
| 468 | NULL, | |
| 469 | NULL, | |
| 470 | NULL, | |
| 471 | NULL, | |
|
8586
c8c7a19da549
[gaim-migrate @ 9336]
Pekka Riikonen <priikone@silcnet.org>
parents:
8546
diff
changeset
|
472 | NULL, |
|
c8c7a19da549
[gaim-migrate @ 9336]
Pekka Riikonen <priikone@silcnet.org>
parents:
8546
diff
changeset
|
473 | NULL |
| 8487 | 474 | }; |
| 475 | ||
| 476 | static GaimPluginInfo info = | |
| 477 | { | |
| 478 | 2, /**< api_version */ | |
| 479 | GAIM_PLUGIN_PROTOCOL, /**< type */ | |
| 480 | NULL, /**< ui_requirement */ | |
| 481 | 0, /**< flags */ | |
| 482 | NULL, /**< dependencies */ | |
| 483 | GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 484 | ||
| 485 | "prpl-rendezvous", /**< id */ | |
| 486 | "Rendezvous", /**< name */ | |
| 487 | VERSION, /**< version */ | |
| 488 | /** summary */ | |
| 489 | N_("Rendezvous Protocol Plugin"), | |
| 490 | /** description */ | |
| 491 | N_("Rendezvous Protocol Plugin"), | |
| 492 | NULL, /**< author */ | |
| 493 | GAIM_WEBSITE, /**< homepage */ | |
| 494 | ||
| 495 | NULL, /**< load */ | |
| 496 | NULL, /**< unload */ | |
| 497 | NULL, /**< destroy */ | |
| 498 | ||
| 499 | NULL, /**< ui_info */ | |
| 500 | &prpl_info /**< extra_info */ | |
| 501 | }; | |
| 502 | ||
| 503 | static void init_plugin(GaimPlugin *plugin) | |
| 504 | { | |
| 505 | GaimAccountUserSplit *split; | |
| 506 | GaimAccountOption *option; | |
| 507 | ||
| 508 | /* Try to avoid making this configurable... */ | |
| 509 | split = gaim_account_user_split_new(_("Host Name"), "localhost", '@'); | |
| 510 | prpl_info.user_splits = g_list_append(prpl_info.user_splits, split); | |
| 511 | ||
| 512 | option = gaim_account_option_string_new(_("First Name"), "first", "Gaim"); | |
| 513 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | |
| 514 | option); | |
| 515 | ||
| 516 | option = gaim_account_option_string_new(_("Last Name"), "last", _("User")); | |
| 517 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | |
| 518 | option); | |
| 519 | ||
| 520 | option = gaim_account_option_bool_new(_("Share AIM screen name"), "shareaim", TRUE); | |
| 521 | prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, | |
| 522 | option); | |
| 523 | ||
| 524 | my_protocol = plugin; | |
| 525 | } | |
| 526 | ||
| 527 | GAIM_INIT_PLUGIN(rendezvous, init_plugin, info); |