changeset 13597:4d8927a4f1ef

[gaim-migrate @ 15983] Move a little bit of code to a better place committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 09 Apr 2006 17:33:25 +0000
parents 849e80570b90
children 41e40b323dc3
files src/protocols/oscar/family_locate.c src/protocols/oscar/oscar.c src/protocols/oscar/oscar_data.c
diffstat 3 files changed, 48 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/family_locate.c	Fri Apr 07 18:39:42 2006 +0000
+++ b/src/protocols/oscar/family_locate.c	Sun Apr 09 17:33:25 2006 +0000
@@ -225,7 +225,9 @@
  *
  * @param userinfo Contains the new information for the buddy.
  */
-static void aim_locate_adduserinfo(OscarData *od, aim_userinfo_t *userinfo) {
+static void
+aim_locate_adduserinfo(OscarData *od, aim_userinfo_t *userinfo)
+{
 	aim_userinfo_t *cur;
 	FlapConnection *conn;
 	aim_rxcallback_t userfunc;
@@ -312,7 +314,9 @@
 		userfunc(od, conn, NULL, cur);
 }
 
-void aim_locate_dorequest(OscarData *od) {
+void
+aim_locate_dorequest(OscarData *od)
+{
 	struct userinfo_node *cur = od->locate.torequest;
 
 	if (cur == NULL)
@@ -393,7 +397,9 @@
 	return was_explicit;
 }
 
-void aim_locate_requestuserinfo(OscarData *od, const char *sn) {
+void
+aim_locate_requestuserinfo(OscarData *od, const char *sn)
+{
 	struct userinfo_node *cur;
 
 	/* Make sure we aren't already requesting info for this buddy */
@@ -431,7 +437,8 @@
 	return NULL;
 }
 
-guint32 aim_locate_getcaps(OscarData *od, ByteStream *bs, int len)
+guint32
+aim_locate_getcaps(OscarData *od, ByteStream *bs, int len)
 {
 	guint32 flags = 0;
 	int offset;
@@ -465,7 +472,8 @@
 	return flags;
 }
 
-guint32 aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len)
+guint32
+aim_locate_getcaps_short(OscarData *od, ByteStream *bs, int len)
 {
 	guint32 flags = 0;
 	int offset;
@@ -493,7 +501,8 @@
 	return flags;
 }
 
-int byte_stream_putcaps(ByteStream *bs, guint32 caps)
+int
+byte_stream_putcaps(ByteStream *bs, guint32 caps)
 {
 	int i;
 
@@ -538,7 +547,8 @@
 }
 #endif
 
-void aim_info_free(aim_userinfo_t *info)
+void
+aim_info_free(aim_userinfo_t *info)
 {
 	free(info->sn);
 	free(info->iconcsum);
@@ -554,7 +564,8 @@
  * AIM is fairly regular about providing user info.  This is a generic
  * routine to extract it in its standard form.
  */
-int aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo)
+int
+aim_info_extract(OscarData *od, ByteStream *bs, aim_userinfo_t *outinfo)
 {
 	int curtlv, tlvcnt;
 	guint8 snlen;
@@ -1311,7 +1322,8 @@
  * XXX pass these in better
  *
  */
-int aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy)
+int
+aim_locate_setinterests(OscarData *od, const char *interest1, const char *interest2, const char *interest3, const char *interest4, const char *interest5, guint16 privacy)
 {
 	FlapConnection *conn;
 	FlapFrame *frame;
@@ -1360,7 +1372,8 @@
  *        0x00000008 - Certification.
  * @return Return 0 if no errors, otherwise return the error number.
  */
-int aim_locate_getinfoshort(OscarData *od, const char *sn, guint32 flags)
+int
+aim_locate_getinfoshort(OscarData *od, const char *sn, guint32 flags)
 {
 	FlapConnection *conn;
 	FlapFrame *frame;
--- a/src/protocols/oscar/oscar.c	Fri Apr 07 18:39:42 2006 +0000
+++ b/src/protocols/oscar/oscar.c	Sun Apr 09 17:33:25 2006 +0000
@@ -1244,11 +1244,12 @@
 	ck[0] = 0x5a;
 }
 
-/* TODO: Move most of this to oscar_data_destroy() */
 static void
 oscar_close(GaimConnection *gc)
 {
-	OscarData *od = (OscarData *)gc->proto_data;
+	OscarData *od;
+
+	od = (OscarData *)gc->proto_data;
 
 	while (od->oscar_chats)
 	{
@@ -1256,33 +1257,18 @@
 		od->oscar_chats = g_slist_remove(od->oscar_chats, cc);
 		oscar_chat_destroy(cc);
 	}
-	while (od->requesticon) {
-		gchar *sn = od->requesticon->data;
-		od->requesticon = g_slist_remove(od->requesticon, sn);
-		g_free(sn);
-	}
-	while (od->create_rooms) {
+	while (od->create_rooms)
+	{
 		struct create_room *cr = od->create_rooms->data;
 		g_free(cr->name);
 		od->create_rooms = g_slist_remove(od->create_rooms, cr);
 		g_free(cr);
 	}
-	if (od->email)
-		g_free(od->email);
-	if (od->newp)
-		g_free(od->newp);
-	if (od->oldp)
-		g_free(od->oldp);
-	if (od->icontimer > 0)
-		gaim_timeout_remove(od->icontimer);
-	if (od->getblisttimer > 0)
-		gaim_timeout_remove(od->getblisttimer);
-	if (od->getinfotimer > 0)
-		gaim_timeout_remove(od->getinfotimer);
-	gaim_prefs_disconnect_by_handle(gc);
-
 	oscar_data_destroy(od);
 	gc->proto_data = NULL;
+
+	gaim_prefs_disconnect_by_handle(gc);
+
 	gaim_debug_info("oscar", "Signed off.\n");
 }
 
--- a/src/protocols/oscar/oscar_data.c	Fri Apr 07 18:39:42 2006 +0000
+++ b/src/protocols/oscar/oscar_data.c	Sun Apr 09 17:33:25 2006 +0000
@@ -92,6 +92,21 @@
 {
 	aim_cleansnacs(od, -1);
 
+	while (od->requesticon)
+	{
+		gchar *sn = od->requesticon->data;
+		od->requesticon = g_slist_remove(od->requesticon, sn);
+		g_free(sn);
+	}
+	g_free(od->email);
+	g_free(od->newp);
+	g_free(od->oldp);
+	if (od->icontimer > 0)
+		gaim_timeout_remove(od->icontimer);
+	if (od->getblisttimer > 0)
+		gaim_timeout_remove(od->getblisttimer);
+	if (od->getinfotimer > 0)
+		gaim_timeout_remove(od->getinfotimer);
 	while (od->oscar_connections != NULL)
 		flap_connection_destroy(od->oscar_connections->data);
 
@@ -109,7 +124,8 @@
 	g_free(od);
 }
 
-int oscar_data_addhandler(OscarData *od, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags)
+int
+oscar_data_addhandler(OscarData *od, guint16 family, guint16 type, aim_rxcallback_t newhandler, guint16 flags)
 {
 	SnacHandler *snac_handler;