annotate plugins/events.c @ 6439:650e9b73ba38

[gaim-migrate @ 6947] "Even if the conversion was successful, this may be less than len if there were partial characters at the end of the input." committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 12 Aug 2003 05:02:56 +0000
parents 8f94cce8faa5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
1 /* events.c
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 *
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 * test every callback, print to stdout
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 *
2130
50c7a704ee56 [gaim-migrate @ 2140]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1404
diff changeset
5 * by EW
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 *
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 * GPL and all that jazz
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 *
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 */
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
11 #define EVENTTEST_PLUGIN_ID "core-eventtest"
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
12
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
13 #include <stdio.h>
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
15 #include "gtkplugin.h"
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
16 #include "connection.h"
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
17 #include "conversation.h"
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
18 #include "internal.h"
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
19
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
20 static void evt_signon(GaimConnection *gc, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
21 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
22 printf("event_signon\n");
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
23 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
24
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
25 static void evt_signoff(GaimConnection *gc, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
26 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
27 printf("event_signoff\n");
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
28 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
29
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
30 static void evt_away(GaimConnection *gc, char *state, char *message, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
31 {
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
32 printf("event_away: %s %s %s\n", gaim_account_get_username(gaim_connection_get_account(gc)),
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
33 state, message);
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
34 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
35
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
36 static void evt_back(void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
37 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
38 printf("event_back\n");
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
39 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
40
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
41 static void evt_im_recv(GaimConnection *gc, char **who, char **what, guint *flags, void *data)
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 {
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
43 printf("event_im_recv: %s %s\n", *who, *what);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
44 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
45
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
46 static void evt_im_send(GaimConnection *gc, char *who, char **what, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
47 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
48 printf("event_im_send: %s %s\n", who, *what);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
49 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
50
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
51 static void evt_buddy_signon(GaimConnection *gc, char *who, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
52 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
53 printf("event_buddy_signon: %s\n", who);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
54 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
55
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
56 static void evt_buddy_signoff(GaimConnection *gc, char *who, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
57 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
58 printf("event_buddy_signoff: %s\n", who);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
59 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
60
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
61 static void evt_buddy_away(GaimConnection *gc, char *who, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
62 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
63 printf("event_buddy_away: %s\n", who);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
64 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
65
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
66 static void evt_buddy_back(GaimConnection *gc, char *who, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
67 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
68 printf("event_buddy_back: %s\n", who);
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 }
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
71 static void evt_buddy_idle(GaimConnection *gc, char *who, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
72 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
73 printf("event_buddy_idle: %s\n", who);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
74 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
75
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
76 static void evt_buddy_unidle(GaimConnection *gc, char *who, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
77 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
78 printf("event_buddy_unidle: %s\n", who);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
79 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
80
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
81 static void evt_blist_update(void *data)
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
82 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
83 printf("event_blist_update\n");
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
84 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
85
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
86 static void evt_chat_invited(GaimConnection *gc, char *who, char *room, char *message, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
87 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
88 printf("event_chat_invited: %s %s %s\n", who, room, message);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
89 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
90
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
91 static void evt_chat_join(GaimConnection *gc, int id, void *data)
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
93 printf("event_chat_join: %d\n", id);
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
94 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
95
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
96 static void evt_chat_leave(GaimConnection *gc, int id, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
97 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
98 printf("event_chat_leave: %d\n", id);
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
99 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
100
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
101 static void evt_chat_buddy_join(GaimConnection *gc, int id, char *who, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
102 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
103 printf("event_chat_buddy_join: %d %s\n", id, who);
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 }
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
106 static void evt_chat_buddy_leave(GaimConnection *gc, int id, char *who, void *data)
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
108 printf("event_chat_buddy_leave: %d %s\n", id, who);
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
109 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
110
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
111 static void evt_chat_recv(GaimConnection *gc, int id, char *who, char *text, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
112 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
113 printf("event_chat_recv: %d %s %s\n", id, who, text);
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 }
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
116 static void evt_chat_send(GaimConnection *gc, int id, char **what, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
117 {
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
118 printf("event_chat_send: %d %s\n", id, *what);
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
119 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
120
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
121 static void evt_warned(GaimConnection *gc, char *who, int level, void *data)
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 {
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
123 printf("event_warned: %s %d\n", who, level);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
124 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
125
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
126 static void evt_error(int error, void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
127 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
128 printf("event_error: %d\n", error);
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
129 }
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
130
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
131 static void evt_quit(void *data)
779
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
132 {
1823a4af82d3 [gaim-migrate @ 789]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 534
diff changeset
133 printf("event_quit\n");
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 }
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135
1047
ece2d1543b20 [gaim-migrate @ 1057]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 808
diff changeset
136 static void evt_new_conversation(char *who, void *data)
808
9d61f3d01046 [gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 779
diff changeset
137 {
9d61f3d01046 [gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 779
diff changeset
138 printf("event_new_conversation: %s\n", who);
9d61f3d01046 [gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 779
diff changeset
139 }
9d61f3d01046 [gaim-migrate @ 818]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 779
diff changeset
140
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
141 static void evt_set_info(GaimConnection *gc, char *info, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
142 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
143 printf("event_set_info: %s\n", info);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
144 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
145
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
146 static void evt_draw_menu(GtkWidget *menu, char *name, void *data)
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
147 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
148 printf("event_draw_menu: %s\n", name);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
149 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
150
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
151 static void evt_im_displayed_sent(GaimConnection *gc, char *who, char **what, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
152 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
153 printf("event_im_displayed_sent: %s %s\n", who, *what);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
154 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
155
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
156 static void evt_im_displayed_rcvd(GaimConnection *gc, char *who, char *what, guint32 flags, time_t time, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
157 {
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
158 printf("event_im_displayed_rcvd: %s %s %u %u\n", who, what, flags, time);
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
159 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
160
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
161 static void evt_chat_send_invite(GaimConnection *gc, int id, char *who, char **msg, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
162 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
163 printf("event_chat_send_invite: %d %s %s\n", id, who, *msg);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
164 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
165
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
166 static void evt_got_typing(GaimConnection *gc, char *who, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
167 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
168 printf("event_got_typing: %s\n", who);
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
169 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
170
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
171 static void evt_del_conversation(GaimConversation *c, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
172 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
173 printf("event_del_conversation\n");
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
174 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
175
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
176 static void evt_connecting(GaimAccount *u, void *data)
5090
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
177 {
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
178 printf("event_connecting\n");
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
179 }
4596276f5b12 [gaim-migrate @ 5452]
Luke Schierer <lschiere@pidgin.im>
parents: 3551
diff changeset
180
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
181 static void evt_change(GaimConversation *c)
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
182 {
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
183 printf("event_conversation_switch\n");
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
184 }
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
185
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
186 /*
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
187 * EXPORTED FUNCTIONS
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
188 */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
189
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
190 static gboolean
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
191 plugin_load(GaimPlugin *plugin)
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192 {
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
193 gaim_signal_connect(plugin, event_signon, evt_signon, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
194 gaim_signal_connect(plugin, event_signoff, evt_signoff, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
195 gaim_signal_connect(plugin, event_away, evt_away, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
196 gaim_signal_connect(plugin, event_back, evt_back, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
197 gaim_signal_connect(plugin, event_im_recv, evt_im_recv, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
198 gaim_signal_connect(plugin, event_im_send, evt_im_send, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
199 gaim_signal_connect(plugin, event_buddy_signon, evt_buddy_signon, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
200 gaim_signal_connect(plugin, event_buddy_signoff, evt_buddy_signoff, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
201 gaim_signal_connect(plugin, event_buddy_away, evt_buddy_away, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
202 gaim_signal_connect(plugin, event_buddy_back, evt_buddy_back, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
203 gaim_signal_connect(plugin, event_chat_invited, evt_chat_invited, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
204 gaim_signal_connect(plugin, event_chat_join, evt_chat_join, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
205 gaim_signal_connect(plugin, event_chat_leave, evt_chat_leave, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
206 gaim_signal_connect(plugin, event_chat_buddy_join, evt_chat_buddy_join, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
207 gaim_signal_connect(plugin, event_chat_buddy_leave, evt_chat_buddy_leave, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
208 gaim_signal_connect(plugin, event_chat_recv, evt_chat_recv, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
209 gaim_signal_connect(plugin, event_chat_send, evt_chat_send, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
210 gaim_signal_connect(plugin, event_warned, evt_warned, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
211 gaim_signal_connect(plugin, event_error, evt_error, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
212 gaim_signal_connect(plugin, event_quit, evt_quit, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
213 gaim_signal_connect(plugin, event_new_conversation, evt_new_conversation, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
214 gaim_signal_connect(plugin, event_set_info, evt_set_info, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
215 gaim_signal_connect(plugin, event_draw_menu, evt_draw_menu, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
216 gaim_signal_connect(plugin, event_im_displayed_sent, evt_im_displayed_sent, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
217 gaim_signal_connect(plugin, event_im_displayed_rcvd, evt_im_displayed_rcvd, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
218 gaim_signal_connect(plugin, event_chat_send_invite, evt_chat_send_invite, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
219 gaim_signal_connect(plugin, event_got_typing, evt_got_typing, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
220 gaim_signal_connect(plugin, event_del_conversation, evt_del_conversation, NULL);
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
221 gaim_signal_connect(plugin, event_connecting, evt_connecting, NULL);
6020
3b6f48766acb [gaim-migrate @ 6470]
Sean Egan <seanegan@gmail.com>
parents: 5920
diff changeset
222 gaim_signal_connect(plugin, event_conversation_switch, evt_change, NULL);
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
223 return TRUE;
534
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 }
d7cdcd9e28f4 [gaim-migrate @ 544]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
226 static GaimPluginInfo info =
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
227 {
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
228 2, /**< api_version */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
229 GAIM_PLUGIN_STANDARD, /**< type */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
230 NULL, /**< ui_requirement */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
231 0, /**< flags */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
232 NULL, /**< dependencies */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
233 GAIM_PRIORITY_DEFAULT, /**< priority */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
234
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
235 EVENTTEST_PLUGIN_ID, /**< id */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
236 N_("Event Test"), /**< name */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
237 VERSION, /**< version */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
238 /** summary */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
239 N_("Test to see that all events are working properly."),
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
240 /** description */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
241 N_("Test to see that all events are working properly."),
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
242 "Eric Warmenhoven <eric@warmenhoven.org>", /**< author */
6371
8f94cce8faa5 [gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents: 6063
diff changeset
243 GAIM_WEBSITE, /**< homepage */
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
244
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
245 plugin_load, /**< load */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
246 NULL, /**< unload */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
247 NULL, /**< destroy */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
248
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
249 NULL, /**< ui_info */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
250 NULL /**< extra_info */
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
251 };
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
252
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
253 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
254 init_plugin(GaimPlugin *plugin)
5255
c0baa01cdeda [gaim-migrate @ 5627]
Luke Schierer <lschiere@pidgin.im>
parents: 5205
diff changeset
255 {
3551
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2130
diff changeset
256 }
cd938f18f3f8 [gaim-migrate @ 3626]
Sean Egan <seanegan@gmail.com>
parents: 2130
diff changeset
257
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 6020
diff changeset
258 GAIM_INIT_PLUGIN(eventtester, init_plugin, info)