237
|
1 Hello, your good friend EW here with a nice little notice that I'm sure will
|
|
2 affect the ten of you who actually read this.
|
|
3
|
|
4 I'm going to start trying to get gaim to use Oscar through libfaim. As far as I
|
|
5 can tell, the only thing it used to be able to do is sign on and receive IMs. I
|
|
6 updated libfaim to what's currently in the libfaim CVS on sourceforge. As of
|
|
7 right now, I haven't even gotten it to sign on, but theoretically it can receive
|
|
8 IMs.
|
|
9
|
|
10 I'm going to try to make as few modifications as possible to the libfaim code.
|
|
11 The only two modifications I'll probably ever make to it are 1) to make my life
|
|
12 easier (like putting all the .h files in the same directory as the .c files) or
|
|
13 2) to fix a compilation error that I happen to be able to fix very easily (like
|
|
14 with a typo or something). That means that what you're getting when you enable
|
|
15 oscar is basically faimtest (the very instructional program included with the
|
|
16 libfaim source on sourceforge) with the Gaim GTK front-end. I'll put any changes
|
|
17 I make into a file, but so far, I haven't made any changes other than moving the
|
|
18 .h files down a directory.
|
|
19
|
|
20 HOW TO HELP
|
|
21 ===========
|
|
22 So here's what you can do in order to help gaim use libfaim. There are basically
|
|
23 3 steps:
|
|
24
|
|
25 1) In server.c, find an #ifndef USE_OSCAR tag that doesn't have a corresponding
|
|
26 #else. Find it in a good fun function that you want to implement. Basically
|
|
27 copy the code from the TOC side for the Oscar side. For example:
|
|
28
|
|
29 void serv_send_im(char *name, char *message, int away)
|
|
30 {
|
|
31 char buf[MSG_LEN - 7];
|
|
32
|
|
33 #ifndef USE_OSCAR
|
|
34 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), message, ((away) ? " auto" : ""));
|
|
35 sflap_send(buf, strlen(buf), TYPE_DATA);
|
|
36 #endif
|
|
37 if (!away)
|
|
38 serv_touch_idle();
|
|
39 }
|
|
40
|
|
41 becomes:
|
|
42
|
|
43 void serv_send_im(char *name, char *message, int away)
|
|
44 {
|
|
45 char buf[MSG_LEN - 7];
|
|
46
|
|
47 #ifndef USE_OSCAR
|
|
48 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
|
|
49 message, ((away) ? " auto" : ""));
|
|
50 sflap_send(buf, strlen(buf), TYPE_DATA);
|
|
51 #else
|
|
52 oscar_send_im(name, message, away);
|
|
53 #endif
|
|
54 if (!away)
|
|
55 serv_touch_idle();
|
|
56 }
|
|
57
|
|
58 2) Edit gaim.h to add the new function (you'll see a list of them in there)
|
|
59
|
|
60 3) Edit oscar.c to implement the new function
|
|
61
|
|
62 Most of the functions you're going to need to call use a session and connection
|
|
63 structure. These are kept statically in oscar.c as gaim_sess and gaim_conn. For
|
|
64 example, from above:
|
|
65
|
|
66 void oscar_send_im(char *name, char *msg, int away) {
|
|
67 if (away)
|
|
68 aim_send_im(gaim_sess, gaim_conn, name, AIM_IMFLAGS_AWAY, msg);
|
|
69 else
|
|
70 aim_send_im(gaim_sess, gaim_conn, name, 0, msg);
|
|
71 }
|
|
72
|
|
73 That should be all that's needed. And that's that. Happy hacking.
|