view plugins/error.c @ 5145:fc09679bffbe

[gaim-migrate @ 5509] (21:17:26) KingAnt: The thing Luke committed a few hours ago. I think it makes it so Buddies->Get User Info gets the info of whoever is highlighted in the buddy list instead of always opening the "enter screenname" box (21:18:25) LSchiere: KingAnt: correct, as the commit message states, that's exactly what it does (21:18:29) Robot101: KingAnt: the menus don't act on buddies in the list (21:18:34) Robot101: the buttons do, but the menus don't (21:18:40) Robot101: so now it's inconsistent. (21:18:47) KingAnt: That's what I was thinking (21:18:51) Robot101: revert. (21:18:53) LSchiere: kay (21:19:09) KingAnt: Well, I was thinking more... if I want to get info of someone who's not on my buddy list, I shouldn't have to unclick on people in the buddy list (21:19:25) Robot101: that too! (21:19:37) LSchiere: i always forget the menu, so that didn't occur to me: i'm used to unclicking committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 17 Apr 2003 01:20:22 +0000
parents cd938f18f3f8
children
line wrap: on
line source

#define GAIM_PLUGINS
#include "gaim.h"

#include <stdlib.h>
#include <time.h>

char *gaim_plugin_error(int);

char *gaim_plugin_init(GModule *handle) {
	int error;

	/* so here, we load any callbacks, do the normal stuff */

	srand(time(NULL));
	error = rand() % 3;
	error -= 2;
	/* there's a 1 in 3 chance there *won't* be an error :) */
	return gaim_plugin_error(error);
}

void gaim_plugin_remove() {
	/* this only gets called if we get loaded successfully, and then
	 * unloaded. */
}

char *gaim_plugin_error(int error) {
	/* by the time we've gotten here, all our callbacks are removed.
	 * we just have to deal with what the error was (as defined by us)
	 * and do any other clean-up stuff we need to do. */
	switch (error) {
	case -1:
		return "MY BAD";
	case -2:
		return "Internal plugin error: exiting.";
	default:
		return NULL;
	}
}

struct gaim_plugin_description desc; 
struct gaim_plugin_description *gaim_plugin_desc() {
	desc.api_version = PLUGIN_API_VERSION;
	desc.name = g_strdup("Error Tester");
	desc.version = g_strdup(VERSION);
	desc.description = g_strdup("A plugin that causes error messages.");
	desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
	desc.url = g_strdup(WEBSITE);
	return &desc;
}

char *name() {
	return "Error Tester " VERSION ;
}

char *description() {
	return "A nice little program that causes error messages";
}