view libfaim/README.gaim @ 251:b1ff272bc495

[gaim-migrate @ 261] Small changes. some things work better. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 22 May 2000 23:57:41 +0000
parents c5aa7bf99059
children 5b28ef2b550e
line wrap: on
line source

Hello, your good friend EW here with a nice little notice that I'm sure will
affect the ten of you who actually read this.

I'm going to start trying to get gaim to use Oscar through libfaim. As far as I
can tell, the only thing it used to be able to do is sign on and receive IMs. I
updated libfaim to what's currently in the libfaim CVS on sourceforge. As of
right now, I've been able to implement most of the features libfaim offers.

I'm going to try to make as few modifications as possible to the libfaim code.
The only two modifications I'll probably ever make to it are 1) to make my life
easier (like putting all the .h files in the same directory as the .c files) or
2) to fix a compilation error that I happen to be able to fix very easily (like
with a typo or something). That means that what you're getting when you enable
oscar is basically faimtest (the very instructional program included with the
libfaim source on sourceforge) with the Gaim GTK front-end. I'll put any changes
I make into a file, but so far, I haven't made any changes other than moving the
.h files down a directory.

And finally, a word of warning. Gaim/Faim is VERY buggy. It'll screw with your
.gaimrc file. It won't always sign on right. It uses all your CPU. Please, don't
use this for anything other than laughs right now. Hopefully we'll get it
working better soon (please help!).

CURRENTLY SUPPORTED FEATURES
============================
Signing on
Sending IMs
Receiving IMs
Being away/coming back
Being idle
Setting your info
Getting users' info
Getting users' away messages (PLEASE do not use oscar/libfaim just because of
	this, gaim with libfaim is still really buggy, none of you will listen
	to me anyway)
Telling the server who's on your permit/deny lists (buggy)
Chat:
 - joining rooms
 - leaving rooms
 - getting invited
 - talking

CURRENTLY UNSUPPORTED FEATURES
==============================
Warning users/getting warned
Chat:
 - whispering
 - refreshing the chatlist in the preferences dialog
 - inviting someone
Getting/setting dir info
Changing your password
File transfer/IM images/voice chat/etc.

KNOWN ISSUES
============
- libfaim apparently has a problem with receiving messages too fast (sort of).
You can receive more messages in less time with TOC than with libfaim. It's not
completely libfaim's fault though.

- Signing on every once in a while acts really bizarrely for me. Maybe it's just
me. I think it has something to do with the horrible lack of error checking and
recovery on gaim's part.

- Adding or removing people to your permit/deny lists causes the server to tell
you everyone on your buddy list signed off and then immediately signed in again.
While you won't ever see that it happens (other than everyone will suddenly have
the guy-in-the-door icon), you'll hear it. Be warned. (This also happens at
sign-on, because the list gets built, even if you don't have a list.)

- It doesn't set the current_user in .gaimrc correctly, so the users listed in
there will get really warped. Don't worry, it's just a problem with the .gaimrc,
but it's an annoying one.

- Oh, yeah, by the way, it'll eat up all your CPU. (Someone please fix this,
there's a nice FIXME near the top of oscar.c that says what the problem is.)

HOW TO HELP
===========
So here's what you can do in order to help gaim use libfaim. There are basically
3 steps:

1) In server.c, find an #ifndef USE_OSCAR tag that doesn't have a corresponding
#else. Find it in a good fun function that you want to implement. Basically
copy the code from the TOC side for the Oscar side. For example:

void serv_send_im(char *name, char *message, int away)
{
	char buf[MSG_LEN - 7];

#ifndef USE_OSCAR
	g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),		   message, ((away) ? " auto" : ""));
	sflap_send(buf, strlen(buf), TYPE_DATA);
#endif
	if (!away)
		serv_touch_idle();
}

becomes:

void serv_send_im(char *name, char *message, int away)
{
        char buf[MSG_LEN - 7];

#ifndef USE_OSCAR
        g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
	           message, ((away) ? " auto" : ""));
	sflap_send(buf, strlen(buf), TYPE_DATA);
#else
	oscar_send_im(name, message, away);
#endif
	if (!away)
		serv_touch_idle();
}

2) Edit gaim.h to add the new function (you'll see a list of them in there)

3) Edit oscar.c to implement the new function

Most of the functions you're going to need to call use a session and connection
structure. These are kept (globally) in oscar.c as gaim_sess and gaim_conn. For
example, from above:

void oscar_send_im(char *name, char *msg, int away) {
	if (away)
		aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
	else
		aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
}

That should be all that's needed.

There are also FIXME's scattered about oscar.c. Grep around for those, figure
out what needs to be fixed, do that sort of thing. :) (Fixing the things listed
in KNOWN ISSUES above, or any other bugs you happen to find, is a very good use
of your time.) (You didn't hear that from me.)