10 void echo_hi(void *m
) {
11 /* this doesn't do much, just lets you know who we are :) */
12 show_about(NULL
, NULL
);
15 void reverse(struct gaim_connection
*gc
, char **who
, char **message
, void *m
) {
16 /* this will drive you insane. whenever you receive a message,
17 * the text of the message (HTML and all) will be reversed. */
21 /* this check is necessary in case bad plugins do bad things */
22 if (message
== NULL
|| *message
== NULL
)
27 if (!strcmp(*who
, gc
->username
))
30 for (i
= 0; i
< l
/2; i
++) {
32 (*message
)[i
] = (*message
)[l
- i
- 1];
33 (*message
)[l
- i
- 1] = tmp
;
37 void bud(struct gaim_connection
*gc
, char *who
, void *m
) {
38 /* whenever someone comes online, it sends them a message. if i
39 * cared more, i'd make it so it popped up on your screen too */
40 serv_send_im(gc
, who
, "Hello!", 0);
43 char *gaim_plugin_init(GModule
*handle
) {
44 /* this is for doing something fun when we sign on */
45 gaim_signal_connect(handle
, event_signon
, echo_hi
, NULL
);
47 /* this is for doing something fun when we get a message */
48 gaim_signal_connect(handle
, event_im_recv
, reverse
, NULL
);
50 /* this is for doing something fun when a buddy comes online */
51 gaim_signal_connect(handle
, event_buddy_signon
, bud
, NULL
);
57 return "Gaim Demonstration Plugin";
61 return "This is a really cool plugin that does a lot of stuff:\n"
62 "- It tells you who wrote the program when you log in\n"
63 "- It reverses all incoming text\n"
64 "- It sends a message to people on your list immediately"