diff plugins/events.c @ 6020:3b6f48766acb

[gaim-migrate @ 6470] Yeah, this *should* work. But maybe it won't. I sure as hell ain't testin it. That's what we pay you for you. This is a plugin event that gets triggered when the user switches tabs in a window. Used in conjunction with GTK signals, you should be able to get a good idea of when a conversation has taken focus. Maybe now the notify plugin can be fixed. While doing this, I noticed that a lot of the plugin documentation stuff is woefully outdated. Someone who wants to get involved with a non-coding project is welcome to send a patch. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 05 Jul 2003 03:09:43 +0000
parents 7d385de2f9cd
children 5239a3b4ab33
line wrap: on
line diff
--- a/plugins/events.c	Sat Jul 05 01:49:07 2003 +0000
+++ b/plugins/events.c	Sat Jul 05 03:09:43 2003 +0000
@@ -9,21 +9,28 @@
  */
 
 #define EVENTTEST_PLUGIN_ID "core-eventtest"
-#include "gaim.h"
+
+#include <stdio.h>
 
-static void evt_signon(struct gaim_connection *gc, void *data)
+#include "gtkplugin.h"
+#include "connection.h"
+#include "conversation.h"
+#include "internal.h"
+
+static void evt_signon(GaimConnection *gc, void *data)
 {
 	printf("event_signon\n");
 }
 
-static void evt_signoff(struct gaim_connection *gc, void *data)
+static void evt_signoff(GaimConnection *gc, void *data)
 {
 	printf("event_signoff\n");
 }
 
-static void evt_away(struct gaim_connection *gc, char *state, char *message, void *data)
+static void evt_away(GaimConnection *gc, char *state, char *message, void *data)
 {
-	printf("event_away: %s %s %s\n", gc->username, state, message);
+	printf("event_away: %s %s %s\n", gaim_account_get_username(gaim_connection_get_account(gc)),
+		state, message);
 }
 
 static void evt_back(void *data)
@@ -31,42 +38,42 @@
 	printf("event_back\n");
 }
 
-static void evt_im_recv(struct gaim_connection *gc, char **who, char **what, guint *flags, void *data)
+static void evt_im_recv(GaimConnection *gc, char **who, char **what, guint *flags, void *data)
 {
 	printf("event_im_recv: %s %s\n", *who, *what);
 }
 
-static void evt_im_send(struct gaim_connection *gc, char *who, char **what, void *data)
+static void evt_im_send(GaimConnection *gc, char *who, char **what, void *data)
 {
 	printf("event_im_send: %s %s\n", who, *what);
 }
 
-static void evt_buddy_signon(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_signon(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_signon: %s\n", who);
 }
 
-static void evt_buddy_signoff(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_signoff(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_signoff: %s\n", who);
 }
 
-static void evt_buddy_away(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_away(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_away: %s\n", who);
 }
 
-static void evt_buddy_back(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_back(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_back: %s\n", who);
 }
 
-static void evt_buddy_idle(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_idle(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_idle: %s\n", who);
 }
 
-static void evt_buddy_unidle(struct gaim_connection *gc, char *who, void *data)
+static void evt_buddy_unidle(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_buddy_unidle: %s\n", who);
 }
@@ -76,42 +83,42 @@
 	printf("event_blist_update\n");
 }
 
-static void evt_chat_invited(struct gaim_connection *gc, char *who, char *room, char *message, void *data)
+static void evt_chat_invited(GaimConnection *gc, char *who, char *room, char *message, void *data)
 {
 	printf("event_chat_invited: %s %s %s\n", who, room, message);
 }
 
-static void evt_chat_join(struct gaim_connection *gc, int id, void *data)
+static void evt_chat_join(GaimConnection *gc, int id, void *data)
 {
 	printf("event_chat_join: %d\n", id);
 }
 
-static void evt_chat_leave(struct gaim_connection *gc, int id, void *data)
+static void evt_chat_leave(GaimConnection *gc, int id, void *data)
 {
 	printf("event_chat_leave: %d\n", id);
 }
 
-static void evt_chat_buddy_join(struct gaim_connection *gc, int id, char *who, void *data)
+static void evt_chat_buddy_join(GaimConnection *gc, int id, char *who, void *data)
 {
 	printf("event_chat_buddy_join: %d %s\n", id, who);
 }
 
-static void evt_chat_buddy_leave(struct gaim_connection *gc, int id, char *who, void *data)
+static void evt_chat_buddy_leave(GaimConnection *gc, int id, char *who, void *data)
 {
 	printf("event_chat_buddy_leave: %d %s\n", id, who);
 }
 
-static void evt_chat_recv(struct gaim_connection *gc, int id, char *who, char *text, void *data)
+static void evt_chat_recv(GaimConnection *gc, int id, char *who, char *text, void *data)
 {
 	printf("event_chat_recv: %d %s %s\n", id, who, text);
 }
 
-static void evt_chat_send(struct gaim_connection *gc, int id, char **what, void *data)
+static void evt_chat_send(GaimConnection *gc, int id, char **what, void *data)
 {
 	printf("event_chat_send: %d %s\n", id, *what);
 }
 
-static void evt_warned(struct gaim_connection *gc, char *who, int level, void *data)
+static void evt_warned(GaimConnection *gc, char *who, int level, void *data)
 {
 	printf("event_warned: %s %d\n", who, level);
 }
@@ -131,7 +138,7 @@
 	printf("event_new_conversation: %s\n", who);
 }
 
-static void evt_set_info(struct gaim_connection *gc, char *info, void *data)
+static void evt_set_info(GaimConnection *gc, char *info, void *data)
 {
 	printf("event_set_info: %s\n", info);
 }
@@ -141,36 +148,40 @@
 	printf("event_draw_menu: %s\n", name);
 }
 
-static void evt_im_displayed_sent(struct gaim_connection *gc, char *who, char **what, void *data)
+static void evt_im_displayed_sent(GaimConnection *gc, char *who, char **what, void *data)
 {
 	printf("event_im_displayed_sent: %s %s\n", who, *what);
 }
 
-static void evt_im_displayed_rcvd(struct gaim_connection *gc, char *who, char *what, guint32 flags, time_t time, void *data)
+static void evt_im_displayed_rcvd(GaimConnection *gc, char *who, char *what, guint32 flags, time_t time, void *data)
 {
 	printf("event_im_displayed_rcvd: %s %s %u %u\n", who, what, flags, time);
 }
 
-static void evt_chat_send_invite(struct gaim_connection *gc, int id, char *who, char **msg, void *data)
+static void evt_chat_send_invite(GaimConnection *gc, int id, char *who, char **msg, void *data)
 {
 	printf("event_chat_send_invite: %d %s %s\n", id, who, *msg);
 }
 
-static evt_got_typing(struct gaim_connection *gc, char *who, void *data)
+static void evt_got_typing(GaimConnection *gc, char *who, void *data)
 {
 	printf("event_got_typing: %s\n", who);
 }
 
-static evt_del_conversation(GaimConversation *c, void *data)
+static void evt_del_conversation(GaimConversation *c, void *data)
 {
 	printf("event_del_conversation\n");
 }
 
-static evt_connecting(struct gaim_account *u, void *data)
+static void evt_connecting(GaimAccount *u, void *data)
 {
 	printf("event_connecting\n");
 }
 
+static void evt_change(GaimConversation *c)
+{
+	printf("event_conversation_switch\n");
+}
 
 /*
  *  EXPORTED FUNCTIONS
@@ -208,7 +219,7 @@
 	gaim_signal_connect(plugin, event_got_typing, 	evt_got_typing, NULL);
 	gaim_signal_connect(plugin, event_del_conversation,	evt_del_conversation, NULL);
 	gaim_signal_connect(plugin, event_connecting,	evt_connecting, NULL);
-
+	gaim_signal_connect(plugin, event_conversation_switch, evt_change, NULL);
 	return TRUE;
 }