changeset 903:16492f41410d

[gaim-migrate @ 913] hm committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 14 Sep 2000 17:12:27 +0000
parents bd5f4997f063
children e1a7fc4482b9
files TODO libfaim/aim_chatnav.c src/buddy.c
diffstat 3 files changed, 125 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Thu Sep 14 01:00:28 2000 +0000
+++ b/TODO	Thu Sep 14 17:12:27 2000 +0000
@@ -1,9 +1,5 @@
 --- STUFF FOR 0.10.1 RELEASE ---
-	Apply/Cancel/OK in Prefs instead of just "Close"
-	Those damn hanging trees are annoying.  I think lethal injections
-		are a much more humane way to handle it.
-	Possibly make blank lines fill with the BG colour?  The user info
-		looks sorta odd but might look better if we do that?  
+	Apply/Cancel/OK in Prefs instead of just "Close" (I don't want this...)
 	Allow users to select sounds for various events
 	Execute Command on Buddy Pounce
 	Have a page in the prefs for the Applet
--- a/libfaim/aim_chatnav.c	Thu Sep 14 01:00:28 2000 +0000
+++ b/libfaim/aim_chatnav.c	Thu Sep 14 17:12:27 2000 +0000
@@ -291,9 +291,114 @@
     case 0x0007: /* search for a room */
       printf("faim: chatnav_parse_info: search results\n");
       break;
-    case 0x0008: /* create room */
-      printf("faim: chatnav_parse_info: response to create room\n");
+    case 0x0008: { /* create room */
+      /*
+	000d 0009 0000 0000 0010 
+	
+	0004 0053 
+	     0004 -- exchange
+	     0c 7a 6f6f 6f6d 7a6f 6f6f 6d34 32 cookie/name
+	     0000 -- instance
+	     02 -- detail level
+	     0007 -- unknown!
+	     006a 000c 7a 6f 6f6f 6d7a 6f6f 6f6d 3432 -- fully qualified name 
+	     00c9 0002 0011 -- flags
+	     00ca 0004 39c0 0883 -- create time
+	     00d1 0002 0200 -- max msg len 
+	     00d2 0002 0018 -- max occupants
+	     00d3 000c -- name
+	          7a6f 6f6f 6d7a 6f6f 6f6d 3432 
+	     00d5 0001 02 -- creation permission
+       */
+      struct aim_tlvlist_t *tlvlist, *innerlist;
+      char *ck = NULL, *fqcn = NULL, *name = NULL;
+      unsigned short exchange, instance, unknown, flags, maxmsglen, maxoccupancy;
+      unsigned long createtime = 0;
+      unsigned char createperms;
+      int i, cklen;
+      struct aim_tlv_t *bigblock, *tmp;
+
+      i = 10;
+      if (!(tlvlist = aim_readtlvchain(command->data+i, command->commandlen-i))) {
+	printf("faim: unable to read top tlv in create room response\n");
+	break;
+      }
+
+      if (!(bigblock = aim_gettlv(tlvlist, 0x0004, 1))) {
+	printf("faim: no bigblock in top tlv in create room response\n");
+	aim_freetlvchain(&tlvlist);
+	break;
+      }
+      i = 0;
+
+      exchange = aimutil_get16(bigblock->value+i);
+      i += 2;
+
+      cklen = aimutil_get8(bigblock->value+i);
+      i++;
+
+      ck = malloc(cklen+1);
+      memcpy(ck, bigblock->value+i, cklen);
+      ck[cklen] = '\0';
+      i += cklen;
+
+      instance = aimutil_get16(bigblock->value+i);
+      i += 2;
+
+      if (aimutil_get8(bigblock->value+i) != 0x02) {
+	printf("faim: unknown detaillevel in create room response (0x%02x)\n", aimutil_get8(bigblock->value+i));
+	aim_freetlvchain(&tlvlist);
+	free(ck);	
+	break;
+      }
+      i += 1;
+      
+      unknown = aimutil_get16(bigblock->value+i);
+      i += 2;
+
+      if (!(innerlist = aim_readtlvchain(bigblock->value+i, bigblock->length-i))) {
+	printf("faim: unable to read inner tlv chain in create room response\n");
+	aim_freetlvchain(&tlvlist);
+	free(ck);
+	break;
+      }
+
+      if (aim_gettlv(innerlist, 0x006a, 1))
+	fqcn = aim_gettlv_str(innerlist, 0x006a, 1);
+
+      if ((tmp = aim_gettlv(innerlist, 0x00c9, 1)))
+	flags = aimutil_get16(tmp->value);
+
+      if ((tmp = aim_gettlv(innerlist, 0x00ca, 1)))
+	createtime = aimutil_get32(tmp->value);
+
+      if ((tmp = aim_gettlv(innerlist, 0x00d1, 1)))
+	maxmsglen = aimutil_get16(tmp->value);
+
+      if ((tmp = aim_gettlv(innerlist, 0x00d2, 1)))
+	maxoccupancy = aimutil_get16(tmp->value);
+
+      if (aim_gettlv(innerlist, 0x00d3, 1))
+	name = aim_gettlv_str(innerlist, 0x00d3, 1);
+
+      if ((tmp = aim_gettlv(innerlist, 0x00d5, 1)))
+	createperms = aimutil_get8(tmp->value);
+
+      if ((userfunc = aim_callhandler(command->conn, 0x000d, 0x0009))) {
+	ret = userfunc(sess, command, snac->type, fqcn, instance, flags, createtime, maxmsglen, maxoccupancy, createperms, unknown, name, ck);
+      }
+     
+      if (ck)
+	free(ck);
+      if (name)
+	free(name);
+      if (fqcn)
+	free(fqcn);
+      aim_freetlvchain(&innerlist);
+      aim_freetlvchain(&tlvlist);
+
       break;
+    }
     default: /* unknown */
       printf("faim: chatnav_parse_info: unknown request subtype (%04x)\n", snac->type);
     }
--- a/src/buddy.c	Thu Sep 14 01:00:28 2000 +0000
+++ b/src/buddy.c	Thu Sep 14 17:12:27 2000 +0000
@@ -198,24 +198,18 @@
 	GList *mem;
         struct buddy *b;
 	struct group *g;
-	int count;
 
         while(grp) {
 		g = (struct group *)grp->data;
                 mem = g->members;
-		count = 0;
                 while(mem) {
 			b = (struct buddy *)mem->data;
 
                         if (b->present || !GTK_WIDGET_VISIBLE(b->item))
 				set_buddy(b);
 
-			if (b->present) count++;
-                        
                         mem = mem->next;
                 }
-		if (!count && (display_options & OPT_DISP_NO_MT_GRP))
-			gtk_widget_hide(g->item);
                 grp = grp->next;
         }
 
@@ -721,6 +715,8 @@
                 
                 update_num_groups();
                 update_show_idlepix();
+		if (b->present)
+			gtk_widget_show(new_g->item);
                 set_buddy(b);
                 
 
@@ -885,6 +881,8 @@
 			   NULL);
         gtk_object_set_user_data(GTK_OBJECT(g->item), NULL);
 	g->members = NULL;
+	if (display_options & OPT_DISP_NO_MT_GRP)
+		gtk_widget_hide(g->item);
 	
  
 	build_edit_tree();
@@ -1270,6 +1268,7 @@
 {
 	struct buddy *b;
 	struct group *g;
+	GList *mem;
 	
 	b = find_buddy(name);
 
@@ -1279,8 +1278,20 @@
         b->log_timer = 0;
 			
 	if (!b->present) {
+		int count = 0;
 		gtk_widget_hide(b->item);
 		g = find_group_by_buddy(name);
+		mem = g->members;
+		while (mem) {
+			b = (struct buddy *)mem->data;
+                        if (b->present) {
+				count++;
+				break;
+			}
+			mem = mem->next;
+		}
+		if (!count && (display_options & OPT_DISP_NO_MT_GRP))
+			gtk_widget_hide(g->item);
 		if (GTK_TREE_ITEM(g->item)->expanded) {
 			gtk_tree_item_collapse(GTK_TREE_ITEM(g->item));
 			gtk_tree_item_expand(GTK_TREE_ITEM(g->item));