changeset 1147:65e0608e19f7

[gaim-migrate @ 1157] I think toc is mostly working, i tested it remotely. Oscar is somewhat working; switching between options doesn't force you offline anymore, so that's good. adding and removing doesn't force you offline either. another plus. but i'm not sure it always recognizes the changes on the server side. hey, that's what you get with a protocol where the only thing you know about it is what you see on the wire. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 27 Nov 2000 13:47:33 +0000
parents 22f3c32a28f6
children 0a14a9a844cb
files src/oscar.c src/prefs.c
diffstat 2 files changed, 66 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/oscar.c	Mon Nov 27 13:31:26 2000 +0000
+++ b/src/oscar.c	Mon Nov 27 13:47:33 2000 +0000
@@ -1826,6 +1826,66 @@
 	gtk_widget_show(entry);
 }
 
+static void oscar_add_permit(struct gaim_connection *gc, char *who) {
+	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
+	if (gc->permdeny != 3) return;
+	aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, who);
+}
+
+static void oscar_add_deny(struct gaim_connection *gc, char *who) {
+	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
+	if (gc->permdeny != 4) return;
+	aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, who);
+}
+
+static void oscar_rem_permit(struct gaim_connection *gc, char *who) {
+	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
+	if (gc->permdeny != 3) return;
+	aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITREMOVE, who);
+}
+
+static void oscar_rem_deny(struct gaim_connection *gc, char *who) {
+	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
+	if (gc->permdeny != 4) return;
+	aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYREMOVE, who);
+}
+
+static void oscar_set_permit_deny(struct gaim_connection *gc) {
+	struct oscar_data *od = (struct oscar_data *)gc->proto_data;
+	GSList *list;
+	char buf[MAXMSGLEN];
+	int at;
+
+	switch(gc->permdeny) {
+	case 1:
+		aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username);
+		break;
+	case 2:
+		aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username);
+		break;
+	case 3:
+		list = gc->permit;
+		at = g_snprintf(buf, sizeof(buf), "%s", gc->username);
+		while (list) {
+			at += g_snprintf(buf + at, sizeof(buf) - at, "&%s", (char *)list->data);
+			list = list->next;
+		}
+		aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, buf);
+		break;
+	case 4:
+		list = gc->deny;
+		at = g_snprintf(buf, sizeof(buf), "%s", gc->username);
+		while (list) {
+			at += g_snprintf(buf + at, sizeof(buf) - at, "&%s", (char *)list->data);
+			list = list->next;
+		}
+		aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, buf);
+		break;
+	default:
+		break;
+	}
+}
+
 void oscar_init(struct prpl *ret) {
 	ret->protocol = PROTO_OSCAR;
 	ret->name = oscar_name;
@@ -1847,11 +1907,11 @@
 	ret->add_buddy = oscar_add_buddy;
 	ret->add_buddies = oscar_add_buddies;
 	ret->remove_buddy = oscar_remove_buddy;
-	ret->add_permit = NULL; /* Oscar's permit/deny stuff is messed up */
-	ret->add_deny = NULL; /* at least, i can't figure it out :-P */
-	ret->rem_permit = NULL;
-	ret->rem_deny = NULL;
-	ret->set_permit_deny = NULL;
+	ret->add_permit = oscar_add_permit;
+	ret->add_deny = oscar_add_deny;
+	ret->rem_permit = oscar_rem_permit;
+	ret->rem_deny = oscar_rem_deny;
+	ret->set_permit_deny = oscar_set_permit_deny;
 	ret->warn = oscar_warn;
 	ret->accept_chat = NULL; /* oscar doesn't have accept, it just joins */
 	ret->join_chat = oscar_join_chat;
--- a/src/prefs.c	Mon Nov 27 13:31:26 2000 +0000
+++ b/src/prefs.c	Mon Nov 27 13:47:33 2000 +0000
@@ -1556,9 +1556,7 @@
 	gtk_container_add(GTK_CONTAINER(prefdialog), box);
 	gtk_widget_show(box);
 
-	label = gtk_label_new(_("No. This doesn't work yet. Nothing actually gets sent to the"
-				" server. But the UI works. That's all I wanted."));
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+	label = gtk_label_new(_("All options take effect immediately unless otherwise noted."));
 	gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 5);
 	gtk_widget_show(label);