--- a/configure.ac Fri Aug 12 00:02:42 2005 -0400
+++ b/configure.ac Fri Aug 12 20:15:12 2005 -0400
@@ -174,7 +174,6 @@
napster) static_napster=yes ;;
novell) static_novell=yes ;;
oscar) static_oscar=yes ;;
- rendezvous) static_rendezvous=yes ;;
trepia) static_trepia=yes ;;
@@ -190,7 +189,6 @@
AM_CONDITIONAL(STATIC_NAPSTER, test "x$static_napster" = "xyes")
AM_CONDITIONAL(STATIC_NOVELL, test "x$static_novell" = "xyes")
AM_CONDITIONAL(STATIC_OSCAR, test "x$static_oscar" = "xyes")
-AM_CONDITIONAL(STATIC_RENDEZVOUS, test "x$static_rendezvous" = "xyes")
AM_CONDITIONAL(STATIC_SILC, test "x$static_silc" = "xyes" -a "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes")
AM_CONDITIONAL(STATIC_TOC, test "x$static_toc" = "xyes")
AM_CONDITIONAL(STATIC_TREPIA, test "x$static_trepia" = "xyes")
@@ -217,7 +215,6 @@
napster) dynamic_napster=yes ;;
novell) dynamic_novell=yes ;;
oscar) dynamic_oscar=yes ;;
- rendezvous) dynamic_rendezvous=yes ;;
silc) dynamic_silc=yes ;;
trepia) dynamic_trepia=yes ;;
@@ -233,7 +230,6 @@
AM_CONDITIONAL(DYNAMIC_NAPSTER, test "x$dynamic_napster" = "xyes")
AM_CONDITIONAL(DYNAMIC_NOVELL, test "x$dynamic_novell" = "xyes")
AM_CONDITIONAL(DYNAMIC_OSCAR, test "x$dynamic_oscar" = "xyes")
-AM_CONDITIONAL(DYNAMIC_RENDEZVOUS, test "x$dynamic_rendezvous" = "xyes")
AM_CONDITIONAL(DYNAMIC_SILC, test "x$dynamic_silc" = "xyes" -a "x$silcincludes" = "xyes" -a "x$silcclient" = "xyes")
AM_CONDITIONAL(DYNAMIC_TOC, test "x$dynamic_toc" = "xyes")
AM_CONDITIONAL(DYNAMIC_TREPIA, test "x$dynamic_trepia" = "xyes")
@@ -1232,7 +1228,6 @@
src/protocols/napster/Makefile
src/protocols/novell/Makefile
src/protocols/oscar/Makefile
- src/protocols/rendezvous/Makefile
src/protocols/silc/Makefile
src/protocols/toc/Makefile
src/protocols/trepia/Makefile
--- a/pixmaps/status/default/Makefile.am Fri Aug 12 00:02:42 2005 -0400
+++ b/pixmaps/status/default/Makefile.am Fri Aug 12 20:15:12 2005 -0400
@@ -5,6 +5,7 @@
@@ -31,7 +32,6 @@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/protocols/Makefile.am Fri Aug 12 20:15:12 2005 -0400
@@ -0,0 +1,3 @@
+DIST_SUBDIRS = gg irc jabber msn napster novell oscar silc toc trepia yahoo zephyr +SUBDIRS = $(DYNAMIC_PRPLS) $(STATIC_PRPLS) --- a/src/protocols/rendezvous/Makefile.am Fri Aug 12 00:02:42 2005 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-librendezvous_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS)
-noinst_LIBRARIES = librendezvous.a
-librendezvous_a_SOURCES = $(RENDEZVOUSSOURCES)
-librendezvous_a_CFLAGS = $(AM_CFLAGS)
-pkg_LTLIBRARIES = librendezvous.la
-librendezvous_la_SOURCES = $(RENDEZVOUSSOURCES)
--- a/src/protocols/rendezvous/rendezvous.c Fri Aug 12 00:02:42 2005 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,720 +0,0 @@
- * gaim - Rendezvous Protocol Plugin
- * Gaim is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#include "conversation.h"
-#define RENDEZVOUS_CONNECT_STEPS 2
-typedef struct _RendezvousData {
-typedef struct _RendezvousBuddy {
-/****************************/
-/****************************/
-static void rendezvous_buddy_free(gpointer data)
- RendezvousBuddy *rb = data;
- g_free(rb->firstandlast);
- * Extract the "user@host" name from a full presence domain
- * of the form "user@host._presence._tcp.local"
- * @return If the domain is NOT a _presence._tcp.local domain
- * then return NULL. Otherwise return a newly allocated
- * null-terminated string containing the "user@host" for
- * the given domain. This string should be g_free'd
- * when no longer needed.
-static gchar *rendezvous_extract_name(gchar *domain)
- if (!g_str_has_suffix(domain, "._presence._tcp.local"))
- suffix = strstr(domain, "._presence._tcp.local");
- ret = g_strndup(domain, suffix - domain);
-/****************************/
-/* Buddy List Functions */
-/****************************/
-static void rendezvous_addtolocal(GaimConnection *gc, const char *name, const char *domain)
- GaimAccount *account = gaim_connection_get_account(gc);
- g = gaim_find_group(domain);
- g = gaim_group_new(domain);
- gaim_blist_add_group(g, NULL);
- b = gaim_find_buddy_in_group(account, name, g);
- b = gaim_buddy_new(account, name, NULL);
- /* gaim_blist_node_set_flag(b, GAIM_BLIST_NODE_FLAG_NO_SAVE); */
- gaim_blist_add_buddy(b, NULL, g, NULL);
- serv_got_update(gc, b->name, TRUE, 0, 0, 0, 0);
- rb = g_hash_table_lookup(rd->buddies, name);
- rb = g_malloc0(sizeof(RendezvousBuddy));
- g_hash_table_insert(rd->buddies, g_strdup(name), rb);
- rb->ttltimer = gaim_timeout_add(time * 10000, rendezvous_buddy_timeout, gc);
- gaim_timeout_remove(rb->ttltimer);
-static void rendezvous_removefromlocal(GaimConnection *gc, const char *name, const char *domain)
- GaimAccount *account = gaim_connection_get_account(gc);
- g = gaim_find_group(domain);
- b = gaim_find_buddy_in_group(account, name, g);
- serv_got_update(gc, b->name, FALSE, 0, 0, 0, 0);
- gaim_blist_remove_buddy(b);
- /* XXX - This results in incorrect group counts--needs to be fixed in the core */
- /* XXX - We also need to call remove_idle_buddy() in server.c for idle buddies */
- * XXX - Instead of removing immediately, wait 10 seconds and THEN remove
- * them. If you do it immediately you don't see the door close icon.
-static void rendezvous_removeallfromlocal(GaimConnection *gc)
- GaimAccount *account = gaim_connection_get_account(gc);
- GaimBlistNode *gnode, *cnode, *bnode;
- /* Go through and remove all buddies that belong to this account */
- if ((blist = gaim_get_blist()) != NULL) {
- for (gnode = blist->root; gnode; gnode = gnode->next) {
- if (!GAIM_BLIST_NODE_IS_GROUP(gnode))
- for (cnode = gnode->child; cnode; cnode = cnode->next) {
- if (!GAIM_BLIST_NODE_IS_CONTACT(cnode))
- for (bnode = cnode->child; bnode; bnode = bnode->next) {
- if (!GAIM_BLIST_NODE_IS_BUDDY(bnode))
- b = (GaimBuddy *)bnode;
- if (b->account != account)
- serv_got_update(gc, b->name, FALSE, 0, 0, 0, 0);
- gaim_blist_remove_buddy(b);
-static void rendezvous_handle_rr_a(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
- RendezvousData *rd = gc->proto_data;
- ResourceRecordRDataSRV *rdata;
- rb = g_hash_table_lookup(rd->buddies, name);
- rb = g_malloc0(sizeof(RendezvousBuddy));
- g_hash_table_insert(rd->buddies, g_strdup(name), rb);
- memcpy(rb->ip, rdata, 4);
-static void rendezvous_handle_rr_txt(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
- RendezvousData *rd = gc->proto_data;
- ResourceRecordRDataTXTNode *node1, *node2;
- /* Don't do a damn thing if the version is greater than 1 */
- node1 = mdns_txt_find(rdata, "version");
- if ((node1 == NULL) || (node1->value == NULL) || (strcmp(node1->value, "1")))
- rb = g_hash_table_lookup(rd->buddies, name);
- rb = g_malloc0(sizeof(RendezvousBuddy));
- g_hash_table_insert(rd->buddies, g_strdup(name), rb);
- node1 = mdns_txt_find(rdata, "1st");
- node2 = mdns_txt_find(rdata, "last");
- g_free(rb->firstandlast);
- rb->firstandlast = g_strdup_printf("%s%s%s",
- (node1 && node1->value ? node1->value : ""),
- (node1 && node1->value && node2 && node2->value ? " " : ""),
- (node2 && node2->value ? node2->value : ""));
- serv_got_alias(gc, name, rb->firstandlast);
- node1 = mdns_txt_find(rdata, "aim");
- if ((node1 != NULL) && (node1->value != NULL)) {
- rb->aim = g_strdup(node1->value);
- * We only want to use this port as a back-up. Ideally the port
- * is specified in a separate, SRV resource record.
- if (rb->p2pjport == 0) {
- node1 = mdns_txt_find(rdata, "port.p2pj");
- if ((node1 != NULL) && (node1->value))
- rb->p2pjport = atoi(node1->value);
- node1 = mdns_txt_find(rdata, "status");
- if ((node1 != NULL) && (node1->value != NULL)) {
- if (!strcmp(node1->value, "avail")) {
- } else if (!strcmp(node1->value, "away")) {
- node2 = mdns_txt_find(rdata, "away");
- if ((node2 != NULL) && (node2->value)) {
- /* Time is seconds since January 1st 2001 GMT */
- rb->idle = atoi(node2->value);
- rb->idle += 978307200; /* convert to seconds-since-epoch */
- } else if (!strcmp(node1->value, "dnd")) {
- rb->status = UC_UNAVAILABLE;
- serv_got_update(gc, name, TRUE, 0, 0, rb->idle, rb->status);
- node1 = mdns_txt_find(rdata, "msg");
- if ((node1 != NULL) && (node1->value != NULL)) {
- rb->msg = g_strdup(node1->value);
-static void rendezvous_handle_rr_srv(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
- RendezvousData *rd = gc->proto_data;
- ResourceRecordRDataSRV *rdata;
- rb = g_hash_table_lookup(rd->buddies, name);
- rb = g_malloc0(sizeof(RendezvousBuddy));
- g_hash_table_insert(rd->buddies, g_strdup(name), rb);
- rb->p2pjport = rdata->port;
- * Parse a resource record and do stuff if we need to.
-static void rendezvous_handle_rr(GaimConnection *gc, ResourceRecord *rr)
- RendezvousData *rd = gc->proto_data;
- gaim_debug_misc("rendezvous", "Parsing resource record with domain name %s\n", rr->name);
- case RENDEZVOUS_RRTYPE_A: {
- name = rendezvous_extract_name(rr->name);
- rendezvous_handle_rr_a(gc, rr, name);
- case RENDEZVOUS_RRTYPE_NULL: {
- name = rendezvous_extract_name(rr->name);
- if (rr->rdlength > 0) {
- /* Data is a buddy icon */
- gaim_buddy_icons_set_for_user(gaim_connection_get_account(gc), name, rr->rdata, rr->rdlength);
- case RENDEZVOUS_RRTYPE_PTR: {
- gchar *rdata = rr->rdata;
- name = rendezvous_extract_name(rdata);
- /* Add them to our buddy list and request their icon */
- rendezvous_addtolocal(gc, name, "Rendezvous");
- mdns_query(rd->fd, rdata, RENDEZVOUS_RRTYPE_NULL);
- /* Remove them from our buddy list */
- rendezvous_removefromlocal(gc, name, "Rendezvous");
- case RENDEZVOUS_RRTYPE_TXT: {
- name = rendezvous_extract_name(rr->name);
- rendezvous_handle_rr_txt(gc, rr, name);
- case RENDEZVOUS_RRTYPE_SRV: {
- name = rendezvous_extract_name(rr->name);
- rendezvous_handle_rr_srv(gc, rr, name);
-/****************************/
-/* Icon and Emblem Functions */
-/****************************/
-static const char* rendezvous_prpl_list_icon(GaimAccount *a, GaimBuddy *b)
-static void rendezvous_prpl_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne)
- if (GAIM_BUDDY_IS_ONLINE(b)) {
- if (b->uc & UC_UNAVAILABLE)
-static gchar *rendezvous_prpl_status_text(GaimBuddy *b)
- GaimConnection *gc = b->account->gc;
- RendezvousData *rd = gc->proto_data;
- rb = g_hash_table_lookup(rd->buddies, b->name);
- if ((rb == NULL) || (rb->msg == NULL))
- ret = g_strdup(rb->msg);
-static gchar *rendezvous_prpl_tooltip_text(GaimBuddy *b)
- GaimConnection *gc = b->account->gc;
- RendezvousData *rd = gc->proto_data;
- rb = g_hash_table_lookup(rd->buddies, b->name);
- ret = g_string_new("");
- g_string_append_printf(ret, "\n<b>%s</b>: %s", _("AIM Screen name"), rb->aim);
- if (rb->status == UC_UNAVAILABLE)
- g_string_append_printf(ret, "\n<b>%s</b>: %s", _("Away"), rb->msg);
- g_string_append_printf(ret, "\n<b>%s</b>: %s", _("Available"), rb->msg);
- return g_string_free(ret, FALSE);
-/****************************/
-/* Connection Functions */
-/****************************/
-static void rendezvous_callback(gpointer data, gint source, GaimInputCondition condition)
- GaimConnection *gc = data;
- RendezvousData *rd = gc->proto_data;
- gaim_debug_misc("rendezvous", "Received rendezvous datagram\n");
- dns = mdns_read(rd->fd);
- /* Handle the DNS packet */
- for (cur = dns->answers; cur != NULL; cur = cur->next)
- rendezvous_handle_rr(gc, cur->data);
- for (cur = dns->authority; cur != NULL; cur = cur->next)
- rendezvous_handle_rr(gc, cur->data);
- for (cur = dns->additional; cur != NULL; cur = cur->next)
- rendezvous_handle_rr(gc, cur->data);
-static void rendezvous_add_to_txt(RendezvousData *rd, const char *name, const char *value)
- ResourceRecordRDataTXTNode *node;
- node = g_malloc(sizeof(ResourceRecordRDataTXTNode));
- node->name = g_strdup(name);
- node->value = value != NULL ? g_strdup(value) : NULL;
- rd->mytxtdata = g_slist_append(rd->mytxtdata, node);
-static guchar *rendezvous_read_icon_data(const char *filename, unsigned short *length)
- g_return_val_if_fail(filename != NULL, NULL);
- if (g_stat(filename, &st))
- if (!(file = g_fopen(filename, "rb")))
- data = g_malloc(*length);
- fread(data, 1, *length, file);
-static void rendezvous_add_to_txt_iconhash(RendezvousData *rd, const char *iconfile)
- unsigned short iconlength;
- unsigned char hash[20];
- g_return_if_fail(rd != NULL);
- icondata = rendezvous_read_icon_data(iconfile, &iconlength);
- shaBlock((unsigned char *)icondata, iconlength, hash);
- base16 = gaim_base16_encode(hash, 20);
- rendezvous_add_to_txt(rd, "phsh", base16);
-static void rendezvous_send_icon(GaimConnection *gc)
- RendezvousData *rd = gc->proto_data;
- GaimAccount *account = gaim_connection_get_account(gc);
- const char *iconfile = gaim_account_get_buddy_icon(account);
- unsigned short rdlength;
- rdata = rendezvous_read_icon_data(iconfile, &rdlength);
- myname = g_strdup_printf("%s._presence._tcp.local", gaim_account_get_username(account));
- mdns_advertise_null(rd->fd, myname, rdata, rdlength);
-static void rendezvous_send_online(GaimConnection *gc)
- RendezvousData *rd = gc->proto_data;
- GaimAccount *account = gaim_connection_get_account(gc);
- gchar *myname, *mycomp;
- me = gaim_account_get_username(account);
- myname = g_strdup_printf("%s._presence._tcp.local", me);
- mycomp = g_strdup_printf("%s.local", strchr(me, '@') + 1);
- /* myip = gaim_network_ip_atoi(gaim_network_get_local_system_ip(-1)); */
- mdns_advertise_a(rd->fd, mycomp, myip);
- mdns_advertise_ptr(rd->fd, "_presence._tcp.local", myname);
- mdns_advertise_srv(rd->fd, myname, 5298, mycomp);
- rendezvous_add_to_txt(rd, "txtvers", "1");
- rendezvous_add_to_txt(rd, "status", "avail");
- /* rendezvous_add_to_txt(rd, "vc", "A!"); */
- rendezvous_add_to_txt_iconhash(rd, gaim_account_get_buddy_icon(account));
- rendezvous_add_to_txt(rd, "1st", gaim_account_get_string(account, "first", "Gaim"));
- if (gaim_account_get_bool(account, "shareaim", FALSE)) {
- for (l = gaim_accounts_get_all(); l != NULL; l = l->next) {
- cur = (GaimAccount *)l->data;
- if (!strcmp(gaim_account_get_protocol_id(cur), "prpl-oscar")) {
- /* XXX - Should the name be normalized? */
- rendezvous_add_to_txt(rd, "AIM", gaim_account_get_username(cur));
- rendezvous_add_to_txt(rd, "version", "1");
- rendezvous_add_to_txt(rd, "msg", "Groovin'");
- rendezvous_add_to_txt(rd, "port.p2pj", "5298");
- rendezvous_add_to_txt(rd, "last", gaim_account_get_string(account, "last", _("User")));
- mdns_advertise_txt(rd->fd, myname, rd->mytxtdata);
- rendezvous_send_icon(gc);
-static void rendezvous_prpl_login(GaimAccount *account)
- GaimConnection *gc = gaim_account_get_connection(account);
- rd = g_new0(RendezvousData, 1);
- rd->buddies = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, rendezvous_buddy_free);
- gaim_connection_update_progress(gc, _("Preparing Buddy List"), 0, RENDEZVOUS_CONNECT_STEPS);
- rendezvous_removeallfromlocal(gc);
- gaim_connection_update_progress(gc, _("Connecting"), 1, RENDEZVOUS_CONNECT_STEPS);
- rd->fd = mdns_socket_establish();
- gaim_connection_error(gc, _("Unable to login to rendezvous"));
- gc->inpa = gaim_input_add(rd->fd, GAIM_INPUT_READ, rendezvous_callback, gc);
- gaim_connection_set_state(gc, GAIM_CONNECTED);
- mdns_query(rd->fd, "_presence._tcp.local", RENDEZVOUS_RRTYPE_ALL);
- rendezvous_send_online(gc);
-static void rendezvous_prpl_close(GaimConnection *gc)
- RendezvousData *rd = (RendezvousData *)gc->proto_data;
- ResourceRecordRDataTXTNode *node;
- gaim_input_remove(gc->inpa);
- rendezvous_removeallfromlocal(gc);
- mdns_socket_close(rd->fd);
- g_hash_table_destroy(rd->buddies);
- while (rd->mytxtdata != NULL) {
- node = rd->mytxtdata->data;
- rd->mytxtdata = g_slist_remove(rd->mytxtdata, node);
-static int rendezvous_prpl_send_im(GaimConnection *gc, const char *who, const char *message, GaimConvImFlags flags)
- gaim_debug_info("rendezvous", "Sending IM\n");
-static void rendezvous_prpl_set_away(GaimConnection *gc, const char *state, const char *text)
- gaim_debug_error("rendezvous", "Set away, state=%s, text=%s\n", state, text);
-static GaimPlugin *my_protocol = NULL;
-static GaimPluginProtocolInfo prpl_info;
-static GaimPluginInfo info =
- GAIM_PLUGIN_PROTOCOL, /**< type */
- NULL, /**< ui_requirement */
- NULL, /**< dependencies */
- GAIM_PRIORITY_DEFAULT, /**< priority */
- "prpl-rendezvous", /**< id */
- "Rendezvous", /**< name */
- VERSION, /**< version */
- N_("Rendezvous Protocol Plugin"),
- N_("Rendezvous Protocol Plugin"),
- GAIM_WEBSITE, /**< homepage */
- &prpl_info, /**< extra_info */
-static void init_plugin(GaimPlugin *plugin)
- GaimAccountUserSplit *split;
- GaimAccountOption *option;
- prpl_info.options = OPT_PROTO_NO_PASSWORD;
- prpl_info.icon_spec.format = "jpeg";
- prpl_info.icon_spec.min_width = 0;
- prpl_info.icon_spec.min_height = 0;
- prpl_info.icon_spec.max_width = 0;
- prpl_info.icon_spec.max_height = 0;
- prpl_info.icon_spec.scale_rules = 0;
- prpl_info.list_icon = rendezvous_prpl_list_icon;
- prpl_info.list_emblems = rendezvous_prpl_list_emblems;
- prpl_info.status_text = rendezvous_prpl_status_text;
- prpl_info.tooltip_text = rendezvous_prpl_tooltip_text;
- prpl_info.login = rendezvous_prpl_login;
- prpl_info.close = rendezvous_prpl_close;
- prpl_info.send_im = rendezvous_prpl_send_im;
- prpl_info.set_away = rendezvous_prpl_set_away;
- if (gethostname(hostname, 255) != 0) {
- gaim_debug_warning("rendezvous", "Error %d when getting host name. Using \"localhost.\"\n", errno);
- strcpy(hostname, "localhost");
- /* Try to avoid making this configurable... */
- split = gaim_account_user_split_new(_("Host name"), hostname, '@');
- prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
- option = gaim_account_option_string_new(_("First name"), "first", "Gaim");
- prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
- option = gaim_account_option_string_new(_("Last name"), "last", _("User"));
- prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
- option = gaim_account_option_bool_new(_("Share AIM screen name"), "shareaim", FALSE);
- prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
-GAIM_INIT_PLUGIN(rendezvous, init_plugin, info);