Index: protocols/oscar/Makefile
===================================================================
--- protocols/oscar/Makefile	(revision ef14a83adbb9036c0006ad460c5e11882a3d7e13)
+++ protocols/oscar/Makefile	(revision 4346c3f4343d0cf67a7eefc381c5b10e15011ce8)
@@ -8,4 +8,8 @@
 
 -include ../../Makefile.settings
+ifdef SRCDIR
+SRCDIR := $(SRCDIR)protocols/oscar/
+CFLAGS += -I$(SRCDIR)
+endif
 
 # [SH] Program variables
@@ -33,5 +37,5 @@
 $(objects): ../../Makefile.settings Makefile
 
-$(objects): %.o: %.c
+$(objects): %.o: $(SRCDIR)%.c
 	@echo '*' Compiling $<
 	@$(CC) -c $(CFLAGS) $< -o $@
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision ef14a83adbb9036c0006ad460c5e11882a3d7e13)
+++ protocols/oscar/oscar.c	(revision 4346c3f4343d0cf67a7eefc381c5b10e15011ce8)
@@ -254,6 +254,4 @@
 
 	u = t = g_strdup(s);
-
-	strcpy(t, s);
 	g_strdown(t);
 
@@ -290,5 +288,5 @@
 	odata = (struct oscar_data *)ic->proto_data;
 
-	if (condition & GAIM_INPUT_READ) {
+	if (condition & B_EV_IO_READ) {
 		if (aim_get_command(odata->sess, conn) >= 0) {
 			aim_rxdispatch(odata->sess);
@@ -362,5 +360,5 @@
 
 	aim_conn_completeconnect(sess, conn);
-	ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
+	ic->inpa = b_input_add(conn->fd, B_EV_IO_READ,
 			oscar_callback, conn);
 	
@@ -493,5 +491,5 @@
 
 	aim_conn_completeconnect(sess, bosconn);
-	ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
+	ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ,
 			oscar_callback, bosconn);
 	imcb_log(ic, _("Connection established, cookie sent"));
@@ -652,4 +650,5 @@
 	struct im_connection *ic = sess->aux_data;
 	struct chat_connection *chatcon;
+	struct groupchat *c = NULL;
 	static int id = 1;
 
@@ -664,5 +663,10 @@
 	chatcon = find_oscar_chat_by_conn(ic, fr->conn);
 	chatcon->id = id;
-	chatcon->cnv = imcb_chat_new(ic, chatcon->show);
+	
+	c = bee_chat_by_title(ic->bee, ic, chatcon->show);
+	if (c && !c->data)
+		chatcon->cnv = c;
+	else
+		chatcon->cnv = imcb_chat_new(ic, chatcon->show);
 	chatcon->cnv->data = chatcon;
 
@@ -703,5 +707,5 @@
 
 	aim_conn_completeconnect(sess, tstconn);
-	odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
+	odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ,
 					oscar_callback, tstconn);
 	
@@ -731,5 +735,5 @@
 
 	aim_conn_completeconnect(sess, tstconn);
-	odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
+	odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ,
 				oscar_callback, tstconn);
 	
@@ -767,5 +771,5 @@
 	aim_conn_completeconnect(sess, ccon->conn);
 	ccon->inpa = b_input_add(tstconn->fd,
-			GAIM_INPUT_READ,
+			B_EV_IO_READ,
 			oscar_callback, tstconn);
 	odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
@@ -934,5 +938,5 @@
 	tmp = normalize(info->sn);
 	imcb_buddy_status(ic, tmp, flags, state_string, NULL);
-	/* imcb_buddy_times(ic, tmp, signon, time_idle); */
+	imcb_buddy_times(ic, tmp, signon, time_idle);
 
 
@@ -1060,6 +1064,5 @@
 	aim_ssi_auth_reply(od->sess, od->conn, uin, 1, "");
 	// aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
-	if(imcb_find_buddy(data->ic, uin) == NULL)
-		imcb_ask_add(data->ic, uin, NULL);
+	imcb_ask_add(data->ic, uin, NULL);
 	
 	g_free(uin);
@@ -1822,4 +1825,5 @@
 	struct oscar_data *odata = (struct oscar_data *)g->proto_data;
 	if (odata->icq) {
+		/** FIXME(wilmer): Hmm, lost the ability to get away msgs here, do we care to get that back?
 		struct buddy *budlight = imcb_find_buddy(g, who);
 		if (budlight)
@@ -1827,4 +1831,5 @@
 				if (budlight->caps & AIM_CAPS_ICQSERVERRELAY)
 					aim_send_im_ch2_geticqmessage(odata->sess, who, (budlight->uc & 0xff80) >> 7);
+		*/
 	} else
 		aim_getinfo(odata->sess, odata->conn, who, AIM_GETINFO_AWAYMESSAGE);
@@ -1953,5 +1958,5 @@
 static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) {
 	struct im_connection *ic = sess->aux_data;
-	struct aim_ssi_item *curitem;
+	struct aim_ssi_item *curitem, *curgroup;
 	int tmp;
 	char *nrm;
@@ -1964,11 +1969,11 @@
 		switch (curitem->type) {
 			case 0x0000: /* Buddy */
-				if ((curitem->name) && (!imcb_find_buddy(ic, nrm))) {
+				if ((curitem->name) && (!imcb_buddy_by_handle(ic, nrm))) {
 					char *realname = NULL;
 
 					if (curitem->data && aim_gettlv(curitem->data, 0x0131, 1))
 						    realname = aim_gettlv_str(curitem->data, 0x0131, 1);
-						
-					imcb_add_buddy(ic, nrm, NULL);
+					
+					imcb_add_buddy(ic, nrm, curgroup->gid == curitem->gid ? curgroup->name : NULL);
 					
 					if (realname) {
@@ -1978,4 +1983,8 @@
 					}
 				}
+				break;
+
+			case 0x0001: /* Group */
+				curgroup = curitem;
 				break;
 
@@ -2520,10 +2529,11 @@
 	static int chat_id = 0;
 	char * chatname;
+	struct groupchat *c;
 	
 	chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "",
 	                           ic->acc->user, chat_id++);
-  
+	
+	c = imcb_chat_new(ic, chatname);
 	ret = oscar_chat_join(ic, chatname, NULL, NULL);
-
 	aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0);
 
