view plugins/ChangeLog @ 12645:fc28451f5d96

[gaim-migrate @ 14983] SF Patch #1314512 from Sadrul (who has a patch for everything) "This patch introduces a flag for protocol plugins that support offline messages (like Y!M and ICQ). This was encouraged by the following conversation: <sadrul> should offline buddies be listed/enabled in the send-to menu? <rekkanoryo> i would think only for protocols that support offline messaging, if it's indicated that the buddy is offline -- <snip> -- <Bleeter> sadrul: personally, I'd like to see a 'supports offline' flag of some description <Bleeter> one could then redirect (via plugins) through email or alternative methods <Bleeter> just a thought <Paco-Paco> yeah, that sounds like a reasonble thing to have This patch uses this flag to disable the buddies in the send-to menu who are offline and the protocol doesn't support offline messages." I made this make the label insensitive instead of the whole menuitem. This should address SimGuy's concerns about inconsistency (i.e. you could create a conversation with someone via the buddy list that you couldn't create via the Send To menu). I also hacked up some voodoo to show the label as sensitive when moused-over, as that looks better (given the label-insensitive thing is itself a hack). I think this works quite well. BUG NOTE: This makes more obvious an existing bug. The Send To menu isn't updated when buddies sign on or off or change status (at least under some circumstances). We need to fix that anyway, so I'm not going to let it hold up this commit. Switching tabs will clear it up. I'm thinking we just might want to build the contents of that menu when it is selected. That would save us a mess of inefficient signal callbacks that update the Send To menus in open windows all the time. AIM NOTE: This assumes that AIM can't offline message. That's not strictly true. You can message invisible users on AIM. However, by design, we can't tell when a user is invisible without resorting to dirty hackery. In practice, this isn't a problem, as you can still select the AIM user from the menu. And really, how often will you be choosing the Invisible contact, rather than the user going Invisible in the middle of a conversation or IMing you while they're Invisible? JABBER NOTE: This assumes that Jabber can always offline message. This isn't strictly true. Sadrul said: I have updated Jabber according to this link which seems to talk about how to determine the existence offline-message support in a server: http://www.jabber.org/jeps/jep-0013.html#discover However, jabber.org doesn't seem to send the required info. So I am not sure about it. He later said: I talked to Nathan and he said offline message support is mostly assumed for most jabber servers. GTalk doesn't yet support it, but they are working on it. So I have made jabber to always return TRUE. If there is truly no way to detect offline messaging capability, then this is an acceptable solution. We could special case Google Talk because of its popularity, and remove that later. It's probably not worth it though. MSN NOTE: This assumes that MSN can never offline message. That's effectively true, but to be technically correct, MSN can offline message if there's already a switchboard conversation open with a user. We could write an offline_message function in the MSN prpl to detect that, but it'd be of limited usefulness, especially given that under most circumstances (where this might matter), the switchboard connection will be closed almost immediately. CVS NOTE: I'm writing to share a tragic little story. I have a PC that I use for Gaim development. One day, I was writing a commit message on it, when all of a suddent it went berserk. The screen started flashing, and the whole commit message just disappeared. All of it. And it was a good commit message! I had to cram and rewrite it really quickly. Needless to say, my rushed commit message wasn't nearly as good, and I blame the PC for that. Seriously, though, what kind of version control system loses your commit message on a broken connection to the server? Stupid! committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 23 Dec 2005 19:26:04 +0000
parents 4bd8e3b65402
children
line wrap: on
line source

version 0.11.0pre5:
	The build process for plugins has changed slightly. Everything still
	works more or less the same from a user point of view, that is, 'make
	file.so' will still turn file.c into a plugin. The build now uses
	libtool in an attempt to increase portability. By using libtool the
	act of compiling and linking has been divided into two steps (to be
	precise it always was two but we only called gcc once; now we call
	libtool twice). PLUGIN_CFLAGS has also been added. Any -D switches you
	were passing in PLUGIN_LIBS should be passed in PLUGIN_CFLAGS now.

version 0.11.0pre1:
	Gaim is now multi-connection based. This represents a significant
	change. Most of the code was modified, though most of the modifications
	were small (referencing an int as part of a struct as opposed to as a
	global int). Plugins need to be modified to match the new function
	declarations and such.

	Gaim now uses GModule from the GLib library for plugins. This brings
	a few changes. gaim_plugin_init is now passed a GModule *, which it
	should use for all of its callbacks. gaim_plugin_init now returns
	char * instead of int instead of void. If gaim_plugin_init returns
	NULL then gaim assumes everything was OK and proceeds. Otherwise, it
	displays the error message and unloads your plugin. There is no more
	gaim_plugin_error (at least, that gaim itself will use. You may wish
	to simply return gaim_plugin_error() in gaim_plugin_init).

	Because gaim now uses GModule, plugins are opened with RTLD_GLOBAL. I
	had previously wanted to avoid this, but there are simply too many
	benefits gained from using GModule to reject it for this reason. This
	means that plugins can now call each other's functions. Beware, this
	has good and bad implications. If you call a function, it will look
	first in your plugin, and then in gaim's global symbol table, including
	other plugins.

	The new system allows for protocol plugins. New protocols (including
	Yahoo, MSN, IRC, ICQ, etc) can be loaded dynamically. However, most
	of these plugins are going to be controlled by the gaim maintainers.
	If you have interest in writing a protocol plugin, please talk to one
	of us before you start.

	That's about all that I'm going to talk about. My SN is EWarmenhoven
	if you have any questions (like what the hell struct gaim_connection is
	and what its relation to struct aim_user is).

version 0.10.0:
	Rather than have a separate CFLAGS and LDFLAGS for the plugins than
	for gaim, and doing all kinds of crazy things to work around the
	problems that creates, the plugins now have the same CFLAGS and LIBS.
	The plugins also have PLUGIN_LIBS which can be passed at make time.
	This makes things like #ifdef USE_APPLET and #ifdef USE_PERL much more
	reliable. (#include "config.h" in order to get all the #defines)

	The internals of gaim plugin events got modified slightly. It should
	have no effect on existing plugins or the way plugins are made. The
	change was to make my life easier adding perl. It should also make
	adding new plugin events even easier than before (though I doubt that
	any more will ever be added). Also, events are printed to the debug
	window.

	event_buddy_away was being triggered every blist_update for every away
	buddy. This got fixed, but now when you sign on, event_buddy_away may
	be called before event_buddy_signon. Not that it should matter much.

	Just after I finish saying that no more events will be added, I go and
	add one. Go figure. Anyway, it's event_new_conversation. Enough people
	asked me to add it, and I found it useful enough, that I finally did
	add it. It gets passed a char *, the name of the person who the
	conversation is with. This gets triggered when a new conversation
	window is created, in case you couldn't figure it out on your own.

	event_blist_update wasn't being called if you weren't reporting idle
	time or if you were idle. This got fixed.

version 0.9.20:
	It's 3 am the night before finals, it's obviously a good time to hack
	gaim.

	This became quite long, and if you don't want to read it all, here's
	the important stuff summed up:
	- 9 new events (see SIGNALS file for more details)
	- int gaim_plugin_init(void *) (no longer returns void, see error.c)
	- void gaim_plugin_unload(void *) (to allow plugin to remove itself)
	- can only load 1 instance of the same plugin
	- PLUGIN_LIBS for extra libraries for plugin

	The first thing to note is that there are about 9 new events plugins
	can attach to, most of them dealing with chat, since I know that was a
	big thing that was missing. Please note that I was nice and decided to
	tack these extra events onto the end of the enum, which means that
	plugins do not have to be recompiled in order for them to still work.

	The big change is that gaim_plugin_init no longer returns void, but
	int.  If it returns 0+, gaim interprets this as there being no error,
	and continues with loading as normal. (This should be backwards-
	compatible: returning 0/1 is the equivalent of returning void.) If it
	returns a number less than 0, there was an error loading detected by
	the plugin. At that point, gaim will try to clean things up by removing
	any callbacks that have been added by the plugin. It will then try to
	call the plugin's gaim_plugin_error function, if there is one. The
	function should take an int (the int returned by gaim_plugin_init) and
	return a char*. If the char* is not NULL, it is displayed by gaim as an
	error message.  The plugin is then unloaded and closed and life goes
	back to normal. If any of that was confusing, it was confusing to me,
	too. I added a plugin, error.c, which should help clear things up.

	Another big thing to note is that plugins can unload themselves. A good
	example of why this is useful is a ticker plugin. If the user closes
	the ticker window, they obviously want the plugin to be unloaded. Gaim
	has no way of knowing that; therefore, the plugin must tell gaim that
	it is to be unloaded. To have a plugin unload itself, simply call
	gaim_plugin_unload(void *) (the void* is the handle passed to
	gaim_plugin_init). Because you are explicitly asking to be removed,
	gaim assumes that you have done any cleanup already, and so does not
	call gaim_plugin_remove. Rather, it simply removes your callbacks and
	unloads the plugin. (There is some trickery to this. Think about it:
	your plugin calls the function, your plugin is unloaded, and execution
	returns to your plugin, which no longer exists. This would cause a
	segfault if it behaved exactly as described. Instead, the plugin is
	removed from the list of plugins, and removed 5 seconds later. By then
	the plugin should be effectively gone, though still in memory.)

	In previous versions of gaim, you could load multiple copies of the
	same plugin. This is no longer the case. The reason for this was that
	there were not two instances of the plugin in memory; rather, one copy
	and two structures representing the same plugin. Then, the callbacks
	would be called twice (since the plugin would most likely act the same
	across multiple instances), and when one was unloaded, all callbacks
	for both instances would be removed. Rather than deal with two copies
	of the same plugin, it is easier and cleaner to only handle one.

	Sometimes it's necessary to link a plugin with libraries other than the
	ones needed for GTK. Before, it was necessary to modify the Makefile to
	do so (which was usually messy since it's generated by GNU automake).
	Now, you can simply set the environment variable PLUGIN_LIBS to be the
	extra libraries you want to link in. For example, to link plugin.c with
	the math library, you can run the command
	PLUGIN_LIBS=-lm make plugin.so
	To link with multiple plugins, make sure to indicate spaces, e.g.
	PLUGIN_LIBS='-lm -lcrypt' make encrypt.so

	There is a new event, event_quit, which signifies that gaim has exited
	correctly (i.e. didn't segfault). Also, after this event is called, all
	plugins are removed, and their gaim_plugin_remove function is called.
	This behavior is different from previous versions; however, it is the
	proper way of doing things, and should have no effect on current
	plugins. The reason event_quit exists despite plugins being removed at
	quit is because a plugin can be removed without gaim quitting. They are
	distinctly separate events.

	The new events mean that some versions of gaim have certain events,
	others don't. The thing I find fascinating though is that even if a
	plugin is compiled for a later version, it will still be backwards-
	compatible, even if it makes use of the newer events. The reason why
	is the names of the events are stored as integers, and those integers
	will never match an event in a prior version. This means you don't
	have to worry about which version the person is using, only which
	version the person is compiling against. For simplicity's sake, please
	assume people are compiling against the latest version. For
	practicality's sake, VERSION is #define'd to be the version you're
	compiling against, starting with 0.9.20. Prior versions do not have
	this defined in the standard plugin Makefile.