changeset 9965:269029c55169

[gaim-migrate @ 10874] I don't even want to know what happened with the merge for rendezvous... committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 08 Sep 2004 00:21:47 +0000
parents 471de1ab46df
children b15c177895b9
files src/protocols/rendezvous/mdns_cache.c src/protocols/rendezvous/mdns_cache.h src/protocols/rendezvous/rendezvous.c
diffstat 3 files changed, 34 insertions(+), 86 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/rendezvous/mdns_cache.c	Tue Sep 07 18:56:50 2004 +0000
+++ b/src/protocols/rendezvous/mdns_cache.c	Wed Sep 08 00:21:47 2004 +0000
@@ -31,7 +31,7 @@
 GSList *rrs = NULL;
 
 static ResourceRecord *
-mdns_cache_find(gchar *name, unsigned short type)
+mdns_cache_find(const gchar *name, unsigned short type)
 {
 	ResourceRecord *rr;
 	GSList *cur;
@@ -51,6 +51,8 @@
 void
 mdns_cache_add(const ResourceRecord *rr)
 {
+	ResourceRecord *new;
+
 	g_return_if_fail(rr != NULL);
 	g_return_if_fail((rr->type != 0) && (rr->type != RENDEZVOUS_RRTYPE_ALL));
 
@@ -61,7 +63,7 @@
 }
 
 void
-mdns_cache_remove(gchar *name, unsigned short type)
+mdns_cache_remove(const gchar *name, unsigned short type)
 {
 	ResourceRecord *rr;
 
@@ -76,14 +78,15 @@
 	mdns_free_rr(rr);
 }
 
-void mdns_cache_remove_all()
+void
+mdns_cache_remove_all()
 {
-	while (resourcerecords != NULL)
-		mdns_cache_remove(resourcerecords->data);
+	mdns_free_rrs(rrs);
 	rrs = NULL;
 }
 
-void mdns_cache_respond(int fd, Question *q)
+void
+mdns_cache_respond(int fd, const Question *q)
 {
 	GSList *slist;
 	ResourceRecord *cur;
--- a/src/protocols/rendezvous/mdns_cache.h	Tue Sep 07 18:56:50 2004 +0000
+++ b/src/protocols/rendezvous/mdns_cache.h	Wed Sep 08 00:21:47 2004 +0000
@@ -31,54 +31,24 @@
 
 #include "mdns.h"
 
-void mdns_cache_add(ResourceRecord *rr);
+/**
+ *
+ */
+void mdns_cache_add(const ResourceRecord *rr);
 
-void mdns_cache_remove(gchar *name, unsigned short type);
+/**
+ *
+ */
+void mdns_cache_remove(const gchar *name, unsigned short type);
 
+/**
+ *
+ */
 void mdns_cache_remove_all();
 
-void mdns_cache_respond(int fd, Question *q);
+/**
+ *
+ */
+void mdns_cache_respond(int fd, const Question *q);
 
 #endif /* _MDNS_CACHE_H_ */
-/**
- * @file mdns_cache.h Multicast DNS resource record caching code.
- *
- * gaim
- *
- * 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
- * source distribution.
- *
- * 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
- *
- */
-
-#ifndef _MDNS_CACHE_H_
-#define _MDNS_CACHE_H_
-
-#include "internal.h"
-#include "debug.h"
-
-#include "mdns.h"
-
-void mdns_cache_add(ResourceRecord *rr);
-
-void mdns_cache_remove(ResourceRecord *rr);
-
-void mdns_cache_remove_all();
-
-void mdns_cache_respond(int fd, Question *q);
-
-#endif /* _MDNS_CACHE_H_ */
--- a/src/protocols/rendezvous/rendezvous.c	Tue Sep 07 18:56:50 2004 +0000
+++ b/src/protocols/rendezvous/rendezvous.c	Wed Sep 08 00:21:47 2004 +0000
@@ -29,33 +29,11 @@
 #include "network.h"
 #include "prpl.h"
 #include "sha.h"
-
-#include "mdns.h"
 #include "util.h"
 #include "version.h"
 
-#define RENDEZVOUS_CONNECT_STEPS 2
-
-typedef struct _RendezvousData {
-	int fd;
-	GHashTable *buddies;
-	GSList *mytxtdata;
-} RendezvousData;
-
-typedef struct _RendezvousBuddy {
-#if 0
-	guint ttltimer;
-#endif
-	gchar *firstandlast;
-	gchar *aim;
-	int ip[4];
-	int p2pjport;
-	int status;
-	int idle;
-	gchar *msg;
-} RendezvousBuddy;
-
-#define UC_IDLE 2
+#include "rendezvous.h"
+#include "mdns.h"
 
 /****************************/
 /* Utility Functions        */
@@ -115,7 +93,7 @@
 	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);
+	serv_got_update(gc, b->name, TRUE, 0);
 
 #if 0
 	RendezvousBuddy *rb;
@@ -145,7 +123,7 @@
 	if (b == NULL)
 		return;
 
-	serv_got_update(gc, b->name, FALSE, 0, 0, 0, 0);
+	serv_got_update(gc, b->name, FALSE, 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 */ 
@@ -177,7 +155,7 @@
 					b = (GaimBuddy *)bnode;
 					if (b->account != account)
 						continue;
-					serv_got_update(gc, b->name, FALSE, 0, 0, 0, 0);
+					serv_got_update(gc, b->name, FALSE, 0);
 					gaim_blist_remove_buddy(b);
 				}
 			}
@@ -199,7 +177,9 @@
 		g_hash_table_insert(rd->buddies, g_strdup(name), rb);
 	}
 
+#if 0
 	memcpy(rb->ip, rdata, 4);
+#endif
 }
 
 static void rendezvous_handle_rr_txt(GaimConnection *gc, ResourceRecord *rr, const gchar *name)
@@ -265,7 +245,8 @@
 			/* Away */
 			rb->status = UC_UNAVAILABLE;
 		}
-		serv_got_update(gc, name, TRUE, 0, 0, rb->idle, rb->status);
+		serv_got_update(gc, name, TRUE, 0);
+		/* XXX - Idle time is rb->idle and status is rb->status */
 	}
 
 	node1 = mdns_txt_find(rdata, "msg");
@@ -366,7 +347,7 @@
 	return "rendezvous";
 }
 
-static void rendezvous_prpl_list_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne)
+static void rendezvous_prpl_list_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne)
 {
 	if (GAIM_BUDDY_IS_ONLINE(b)) {
 		if (b->uc & UC_UNAVAILABLE)
@@ -631,11 +612,6 @@
 	return 1;
 }
 
-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;
@@ -691,7 +667,6 @@
 	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);