Mercurial > pidgin
view plugins/gaiminc.c @ 221:b2f9f629525e
[gaim-migrate @ 231]
Added on the beginnings of file sending. Win clients can now figure out which
file you're *trying* to send them, but can't get it.
The AIM method of Get File is really fscked up, IMHO. I don't know if any of
you are familiar with it, but I'll describe it. Some user decides they want
to download a file from another user, so they choose Get File. It then returns
a list of files available from that person, and they can choose which ones they
want to download.
The other person can't decide on a user-by-user basis which files are listed,
only if any files are listed at all (not allowing people to download them).
The way I'm going to implement it is when someone gets a message that another
person is trying to download a file from them, it asks them which file they
want to make available. You can only do one file at a time this way, but that's
tough if you want to be downloading more than one file. Use gnutella or FTP or
something that's better designed for it than AIM. But the way the win AIM
clients are now, it acts as a public ftp server, and I think it shouldn't.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 07 May 2000 01:50:06 +0000 |
parents | f810fc7d423f |
children | ece2d1543b20 |
line wrap: on
line source
#define GAIM_PLUGINS #include <gtk/gtk.h> #include <time.h> #include <stdio.h> #include <fcntl.h> #include <string.h> #include "gaim.h" void echo_hi(void *m) { /* this doesn't do much, just lets you know who we are :) */ show_about(NULL, NULL); } void reverse(char **who, char **message, void *m) { /* this will drive you insane. whenever you receive a message, * the text of the message (HTML and all) will be reversed. */ int i, l; char tmp; /* this check is necessary in case bad plugins do bad things */ if (message == NULL || *message == NULL) return; l = strlen(*message); if (!strcmp(*who, current_user->username)) return; for (i = 0; i < l/2; i++) { tmp = (*message)[i]; (*message)[i] = (*message)[l - i - 1]; (*message)[l - i - 1] = tmp; } } void bud(char *who, void *m) { /* whenever someone comes online, it sends them a message. if i * cared more, i'd make it so it popped up on your screen too */ serv_send_im(who, "Hello!", 0); } void gaim_plugin_init(void *handle) { /* this is for doing something fun when we sign on */ gaim_signal_connect(handle, event_signon, echo_hi, NULL); /* this is for doing something fun when we get a message */ gaim_signal_connect(handle, event_im_recv, reverse, NULL); /* this is for doing something fun when a buddy comes online */ gaim_signal_connect(handle, event_buddy_signon, bud, NULL); } char *name() { return "Gaim Demonstration Plugin"; } char *description() { return "This is a really cool plugin that does a lot of stuff:\n" "- It tells you who wrote the program when you log in\n" "- It reverses all incoming text\n" "- It sends a message to people on your list immediately" " when they sign on"; }