changeset 1038:daad2440a642

[gaim-migrate @ 1048] i have homework i need to be doing. it's due in less than 7 hours, and i haven't started and i need to sleep. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 31 Oct 2000 10:49:53 +0000
parents 1c663beef29d
children 67ed2ee5be9f
files FIXME HACKING STATUS plugins/ChangeLog plugins/SIGNALS src/gaim.h src/idle.c src/oscar.c src/plugins.c src/prpl.h src/server.c src/toc.c
diffstat 12 files changed, 79 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/FIXME	Tue Oct 31 09:48:42 2000 +0000
+++ b/FIXME	Tue Oct 31 10:49:53 2000 +0000
@@ -27,3 +27,7 @@
 7. Need to do Buddy Pounces on a per-connection basis
 
 8. Need to report logins/outs to convo window
+
+9. Need to get the permit/deny stuff put back
+
+10. Need to have per-connection protocol options (e.g. which server to connect to for IRC)
--- a/HACKING	Tue Oct 31 09:48:42 2000 +0000
+++ b/HACKING	Tue Oct 31 10:49:53 2000 +0000
@@ -34,19 +34,20 @@
 of the information that's printed is useless anyway though; so the
 --enable-debug option really doesn't do a whole lot.
 
-This file was last modified by $Author: warmenhoven $ on $Date: 2000-10-12 14:59:36 -0400 (Thu, 12 Oct 2000) $.
+This file was last modified by $Author: warmenhoven $ on $Date: 2000-10-31 05:49:53 -0500 (Tue, 31 Oct 2000) $.
 
 
 PROGRAM FLOW
 ============
 
 Before gaim does anything you can see, it initializes itself, which is
-mostly just reading .gaimrc (handled by the functions in gaimrc.c). It
-then draws the login window by calling show_login, and waits for input.
+mostly just reading .gaimrc (handled by the functions in gaimrc.c) and
+parsing command-line options. It then draws the login window by calling
+show_login, and waits for input.
 
 At the login window, when "Accounts" is clicked, account_editor() is
-called. (NOTE: the login window will probably be changed soon.) This
-then displays all of the users and various information about them.
+called. This then displays all of the users and various information about
+them. If the user clicks the "Signon" button instead, serv_login is called.
 
 When the "Sign on/off" button is clicked, serv_login is passed the
 username and the password for the account. If the password length is
@@ -61,7 +62,7 @@
 are going to change the login process, since it pretty much just follows
 PROTOCOL), Gaim draws the buddy list by calling show_buddy_list, and
 waits for input from two places: the server and the user. The first place
-it gets input from after signon is invariably the server, when the server
+it gets input from after signon is usually the server, when the server
 tells Gaim which buddies are signed on.
 
 When there is information ready to be read from the server, toc_callback
@@ -70,13 +71,6 @@
 conversation windows of the update if need be; notifying the plugins;
 and finally, calling set_buddy.
 
-set_buddy is one of the most frequently called functions in gaim, one of
-the largest functions in gaim, and probably one of the buggiest functions
-in gaim. It is responsible for updating the pixmaps in the buddy list;
-notifying plugins of various events; updating the tooltips for buddies;
-making sounds; and updating the ticker. It's also called once per online
-buddy every 20 seconds per connection (by GTK through update_all_buddies).
-
 New connections happen the exact same way as described above. Each aim_user
 can have one gaim_connection associated with it. aim_user and gaim_connection
 both have a protocol field; gaim_connection's should be constant once it is
@@ -88,9 +82,7 @@
 That's easy enough. If there isn't a conversation with the person already
 open (checked by calling find_conversation), show_conv is called to
 create the new window. All sorts of neat things happen there, but it's
-mostly drawing the window. show_conv is the best place to edit the UI. Be
-prepared for some incredibly bad GTK programming. (Rob's fixing this as
-we speak no doubt.)
+mostly drawing the window. show_conv is the best place to edit the UI.
 
 That's pretty much it for the quick tutorial. I know it wasn't much but
 it's enough to get you started. Make sure you know GTK before you get too
@@ -176,10 +168,9 @@
   GtkHTML widget.  http.c would be a more appropriate name, but that's OK.
 
 idle.c:
-  There is a very good reason why this file is still on version 1.1
-  in CVS.  The entire thing is #if 0'd out. I haven't ever really taken
-  a good look at it, but I think what it was supposed to have done is
-  set you as being away when a screensaver came on.
+  This file used to be entirely #if 0'd out of existance. However, thanks
+  to some very generous people who submitted patches, this takes care of
+  reporting idle time (imagine that). It's a pretty straight-forward file.
 
 multi.c:
   This is the file that tries to take care of most of the major issues
@@ -190,9 +181,7 @@
   concerned with. If you want to remove multiconnectivity from gaim,
   all you would really need to do is comment out any lines that make
   reference to this function (there are only two - one in aim.c and one
-  in buddy.c). The login window UI would have to be changed but it would
-  be simple to take an old version of gaim and copy code (it won't drop-in
-  because there were other changes, but it should be simple to hand-edit).
+  in buddy.c). Or you could just run ./configure --disable-multi.
 
 network.c:
   This has two functions: get_address and connect_address, both of which
@@ -229,6 +218,12 @@
   preferences. It's very simple, and if you look at a couple of the
   calls to gaim_button you'll figure it out right away.
 
+prpl.c:
+  This file is what lets gaim dynamically load protocols, sort of. All of
+  the actual dlopen(), dlsym() stuff is in plugins.c. But this contains
+  all of the functions that the protocol plugin needs to call, and manages
+  all of the protocols. It's a pretty simple file actually.
+
 proxy.c:
   This is where the bulk of the actual networking code is done. The big
   function here is proxy_connect, which will connect through the proxy
@@ -247,11 +242,11 @@
   serv_got_update. Most of it should be pretty self-explanatory.
 
 sound.c:
-  The big important function is play_sound, which plays one of 4 (actually
-  6) sounds. One of the sounds is called in 3 different events, which
-  is why there are actually 6 sounds. This then calls play which then
-  checks for esd, then nas if that's not available, then falls back
-  to /dev/audio.
+  The main function in this file is play_sound, which plays one of 8
+  (maybe 9?) sounds based on preferences. All that the rest of the
+  code should have to do is call play_sound(BUDDY_ARRIVE), for example,
+  and this file will take care of determining if a sound should be played
+  and which file should be played.
 
 ticker.c:
   Syd is just so cool. I really can't get over it. He let me come
--- a/STATUS	Tue Oct 31 09:48:42 2000 +0000
+++ b/STATUS	Tue Oct 31 10:49:53 2000 +0000
@@ -1,4 +1,4 @@
-STATUS of GAIM CVS tree. Last modified $Date: 2000-10-27 03:53:32 -0400 (Fri, 27 Oct 2000) $ by $Author: warmenhoven $.
+STATUS of GAIM CVS tree. Last modified $Date: 2000-10-31 05:49:53 -0500 (Tue, 31 Oct 2000) $ by $Author: warmenhoven $.
 
 This file is meant to provide gaim users who use the CVS version to see whether
 they actually want to compile what they just checked out. Gaim CVS is usually
@@ -64,9 +64,10 @@
 Plugins
 =======
 
-The plugin system is mostly up and running again, with multi-connectivity added in
-appropriate places. There may still be some bugginess and it lacks some features
-that I want to add, but at least it's mostly working again.
+Plugins are more or less done. There may be some back-end reworking, but if you
+want to start porting plugins from 0.10 to 0.11 then now's a good time to start
+that. I don't think it's going to change much (if at all).
+
 
 Perl
 ====
--- a/plugins/ChangeLog	Tue Oct 31 09:48:42 2000 +0000
+++ b/plugins/ChangeLog	Tue Oct 31 10:49:53 2000 +0000
@@ -10,7 +10,10 @@
 	Look at the updates SIGNALS file to see what the new arguments passed
 	to your handlers are. In some cases the only change necessary will be
 	to modify the function declaration; in many cases the changes will be
-	much more substantial.
+	much more substantial. The only thing really to say here is that there
+	is no more event_blist_update. This event may make a comeback, but
+	that seems doubtful at this point. The good news is that you shouldn't
+	need it anymore anyway.
 
 	The new system allows for protocol plugins. New protocols (including
 	Yahoo, MSN, IRC, ICQ, etc) can be loaded dynamically. However, most
--- a/plugins/SIGNALS	Tue Oct 31 09:48:42 2000 +0000
+++ b/plugins/SIGNALS	Tue Oct 31 10:49:53 2000 +0000
@@ -11,7 +11,6 @@
 	event_buddy_back,
 	event_buddy_idle,
 	event_buddy_unidle,
-	event_blist_update,
 	event_chat_invited,
 	event_chat_join,
 	event_chat_leave,
@@ -101,42 +100,36 @@
 		do so ;-) .)
 
 event_buddy_signon:
-	char *who
+	struct gaim_connection *gc, char *who
 	
 	'who' is who signed on. (There is currently no way to see which connection
 	reported that the buddy came online. Hopefully this will happen soon.)
 
 event_buddy_signoff:
-	char *who
+	struct gaim_connection *gc, char *who
 
 	'who' is who signed off.
 
 event_buddy_away:
-	char *who
+	struct gaim_connection *gc, char *who
 
 	'who' is who went away.
 
 event_buddy_back:
-	char *who
+	struct gaim_connection *gc, char *who
 
 	'who' is who is no longer away.
 
 event_buddy_idle:
-	char *who
+	struct gaim_connection *gc, char *who
 
 	'who' is who went idle.
 
 event_buddy_unidle:
-	char *who
+	struct gaim_connection *gc, char *who
 
 	'who' is who is no longer idle.
 
-event_blist_update:
-	(none)
-	
-	This event is called when the buddylist is updated (automatically every
-	20 seconds for every connection, though the updates are usually syncopated)
-
 event_chat_invited:
 	struct gaim_connection *gc, char *who, char *room, char *message
 
--- a/src/gaim.h	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/gaim.h	Tue Oct 31 10:49:53 2000 +0000
@@ -181,7 +181,6 @@
 	event_buddy_back,
 	event_buddy_idle,
 	event_buddy_unidle,
-	event_blist_update,
 	event_chat_invited,
 	event_chat_join,
 	event_chat_leave,
--- a/src/idle.c	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/idle.c	Tue Oct 31 10:49:53 2000 +0000
@@ -47,8 +47,6 @@
 #endif
 
         /* Not idle, really...  :) */
-
-	plugin_event(event_blist_update, 0, 0, 0, 0);
         
 	time(&t);
 
--- a/src/oscar.c	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/oscar.c	Tue Oct 31 10:49:53 2000 +0000
@@ -353,19 +353,22 @@
 		switch (sess->logininfo.errorcode) {
 		case 0x18:
 			/* connecting too frequently */
-			do_error_dialog(_("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."), _("Gaim - Error"));
+			hide_login_progress(gc, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
 			plugin_event(event_error, (void *)983, 0, 0, 0);
 			break;
 		case 0x05:
 			/* Incorrect nick/password */
-			do_error_dialog(_("Incorrect nickname or password."), _("Gaim - Error"));
+			hide_login_progress(gc, _("Incorrect nickname or password."));
 			plugin_event(event_error, (void *)980, 0, 0, 0);
 			break;
 		case 0x1c:
 			/* client too old */
-			do_error_dialog(_("The client version you are using is too old. Please upgrade at http://www.marko.net/gaim/"), _("Gaim - Error"));
+			hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at http://www.marko.net/gaim/"));
 			plugin_event(event_error, (void *)989, 0, 0, 0);
 			break;
+		default:
+			hide_login_progress(gc, _("Authentication Failed"));
+			break;
 		}
 		sprintf(debug_buff, "Login Error Code 0x%04x\n",
 				sess->logininfo.errorcode);
@@ -376,8 +379,6 @@
 #ifdef USE_APPLET
 		set_user_state(offline);
 #endif
-		gdk_input_remove(gc->inpa);
-		hide_login_progress(gc, _("Authentication Failed"));
 		signoff(gc);
 		return 0;
 	}
@@ -1395,6 +1396,9 @@
 	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->warn = oscar_warn;
 	ret->accept_chat = NULL; /* oscar doesn't have accept, it just joins */
 	ret->join_chat = oscar_join_chat;
--- a/src/plugins.c	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/plugins.c	Tue Oct 31 10:49:53 2000 +0000
@@ -577,9 +577,6 @@
 		case event_buddy_unidle:
 			sprintf(buf, "event_buddy_unidle");
 			break;
-		case event_blist_update:
-			sprintf(buf, "event_blist_update");
-			break;
 		case event_chat_invited:
 			sprintf(buf, "event_chat_invited");
 			break;
@@ -646,7 +643,6 @@
 			/* no args */
 			case event_away:
 			case event_back:
-			case event_blist_update:
 			case event_quit:
 				{
 					void (*function)(void *) = g->function;
@@ -780,9 +776,6 @@
 		case event_buddy_unidle:
 			g_snprintf(buf, sizeof buf, "\"%s\"", (char *)arg1);
 			break;
-		case event_blist_update:
-			buf[0] = 0;
-			break;
 		case event_chat_invited:
 			g_snprintf(buf, sizeof buf, "\"%s\" \"%s\" %s", (char *)arg2, (char *)arg3, (char *)arg4);
 			break;
--- a/src/prpl.h	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/prpl.h	Tue Oct 31 10:49:53 2000 +0000
@@ -75,6 +75,9 @@
 	void (* remove_buddy)	(struct gaim_connection *, char *name);
 	void (* add_permit)	(struct gaim_connection *, char *name);
 	void (* add_deny)	(struct gaim_connection *, char *name);
+	void (* rem_permit)	(struct gaim_connection *, char *name);
+	void (* rem_deny)	(struct gaim_connection *, char *name);
+	void (* set_permit_deny)(struct gaim_connection *);
 	void (* warn)		(struct gaim_connection *, char *who, int anonymous);
 	void (* accept_chat)	(struct gaim_connection *, int id);
 	void (* join_chat)	(struct gaim_connection *, int id, char *name);
--- a/src/server.c	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/server.c	Tue Oct 31 10:49:53 2000 +0000
@@ -198,32 +198,37 @@
 		(*g->prpl->remove_buddy)(g, name);
 }
 
-void serv_add_permit(struct gaim_connection *gc, char *name)
+void serv_add_permit(struct gaim_connection *g, char *name)
 {
-	/* FIXME */
+	if (g->prpl && g->prpl->add_permit)
+		(*g->prpl->add_permit)(g, name);
 }
 
-void serv_add_deny(struct gaim_connection *gc, char *name)
+void serv_add_deny(struct gaim_connection *g, char *name)
 {
-	/* FIXME */
+	if (g->prpl && g->prpl->add_deny)
+		(*g->prpl->add_deny)(g, name);
 }
 
-void serv_rem_permit(struct gaim_connection *gc, char *name)
+void serv_rem_permit(struct gaim_connection *g, char *name)
 {
-	/* FIXME */
+	if (g->prpl && g->prpl->rem_permit)
+		(*g->prpl->rem_permit)(g, name);
 }
 
-void serv_rem_deny(struct gaim_connection *gc, char *name)
+void serv_rem_deny(struct gaim_connection *g, char *name)
 {
-	/* FIXME */
+	if (g->prpl && g->prpl->rem_deny)
+		(*g->prpl->rem_deny)(g, name);
 }
 
-void serv_set_permit_deny(struct gaim_connection *gc)
+void serv_set_permit_deny(struct gaim_connection *g)
 {
-	/* FIXME */
 	/* this is called when some other function has modified the permit/deny list and
 	 * now wants to register that change with the server. if you're just adding/removing
 	 * one name, use the add/remove functions above */
+	if (g->prpl && g->prpl->set_permit_deny)
+		(*g->prpl->set_permit_deny)(g);
 }
 
 
@@ -406,8 +411,6 @@
                 return;
         }
 
-	debug_printf("got update for %s\n", b->name);
-
         /* This code will 'align' the name from the TOC */
         /* server with what's in our record.  We want to */
         /* store things how THEY want it... */
@@ -442,16 +445,16 @@
 
         }
 
-	if (!b->idle && idle) plugin_event(event_buddy_idle, b->name, 0, 0, 0);
-	if (b->idle && !idle) plugin_event(event_buddy_unidle, b->name, 0, 0, 0);
+	if (!b->idle && idle) plugin_event(event_buddy_idle, gc, b->name, 0, 0);
+	if (b->idle && !idle) plugin_event(event_buddy_unidle, gc, b->name, 0, 0);
 
         b->idle = idle;
         b->evil = evil;
 
 	if ((b->uc & UC_UNAVAILABLE) && !(type & UC_UNAVAILABLE)) {
-		plugin_event(event_buddy_back, b->name, 0, 0, 0);
+		plugin_event(event_buddy_back, gc, b->name, 0, 0);
 	} else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) {
-		plugin_event(event_buddy_away, b->name, 0, 0, 0);
+		plugin_event(event_buddy_away, gc, b->name, 0, 0);
 	}
 
         b->uc = type;
@@ -463,11 +466,11 @@
                 if (!b->present) {
                         b->present = 1;
                         do_pounce(b->name);
-			plugin_event(event_buddy_signon, b->name, 0, 0, 0);
+			plugin_event(event_buddy_signon, gc, b->name, 0, 0);
                 }
         } else {
 		if (b->present)
-			plugin_event(event_buddy_signoff, b->name, 0, 0, 0);
+			plugin_event(event_buddy_signoff, gc, b->name, 0, 0);
                 b->present = 0;
 	}
 
--- a/src/toc.c	Tue Oct 31 09:48:42 2000 +0000
+++ b/src/toc.c	Tue Oct 31 10:49:53 2000 +0000
@@ -46,7 +46,7 @@
 #include "pixmaps/dt_icon.xpm"
 #include "pixmaps/free_icon.xpm"
 
-#define REVISION "gaim:$Revision: 1042 $"
+#define REVISION "gaim:$Revision: 1048 $"
 
 struct toc_data {
 	int toc_fd;
@@ -1165,6 +1165,9 @@
         ret->remove_buddy = toc_remove_buddy;
         ret->add_permit = NULL; /* FIXME */
         ret->add_deny = NULL;
+	ret->rem_permit = NULL;
+	ret->rem_deny = NULL;
+	ret->set_permit_deny = NULL;
         ret->warn = toc_warn;
         ret->accept_chat = toc_accept_chat;
         ret->join_chat = toc_join_chat;