# HG changeset patch # User Eric Warmenhoven # Date 958863620 0 # Node ID f6e8ea29b24ff2023a69ef7e35fb6f41fd1a79ac # Parent 2c5713cd9d8c6265ae251d9d27ea0dce192e69e6 [gaim-migrate @ 257] OSCAR: getting a user's info now displays in the dialog window as opposed to the debug window you can add people to your permit/deny list (but be warned - you will get a lot of noise if you do) committer: Tailor Script diff -r 2c5713cd9d8c -r f6e8ea29b24f ChangeLog --- a/ChangeLog Sat May 20 21:01:59 2000 +0000 +++ b/ChangeLog Sat May 20 23:00:20 2000 +0000 @@ -10,6 +10,7 @@ (AOL does not back up machines that contain TOC-based buddy lists, unfortunately). (Thanks Syd) * Font selection dialog + * Small changes to the Oscar/libfaim stuff (it works now, sort of) version 0.9.15: (05/06/2000) * Plugin support enabled by default (oops) diff -r 2c5713cd9d8c -r f6e8ea29b24f libfaim/CHANGES.gaim --- a/libfaim/CHANGES.gaim Sat May 20 21:01:59 2000 +0000 +++ b/libfaim/CHANGES.gaim Sat May 20 23:00:20 2000 +0000 @@ -1,3 +1,11 @@ + +Sat May 20 22:42:24 UTC 2000 EWarmenhoven + - Getting a user's info now displays the familiar dialog window + - You can now add people to your permit/deny list (I think - but I + also think I did it wrong) + - It's been a busy day, I think I'm done until libfaim gets updated + again (which means no chat for a while, sorry) + Sat May 20 09:56:16 UTC 2000 EWarmenhoven - That 2 second delay in updates is gone, and I think it's actually faster than the TOC code now. diff -r 2c5713cd9d8c -r f6e8ea29b24f libfaim/README.gaim --- a/libfaim/README.gaim Sat May 20 21:01:59 2000 +0000 +++ b/libfaim/README.gaim Sat May 20 23:00:20 2000 +0000 @@ -17,6 +17,28 @@ I make into a file, but so far, I haven't made any changes other than moving the .h files down a directory. +CURRENTLY SUPPORTED FEATURES +============================ +Signing on +Sending IMs +Receiving IMs +Being away/coming back +Being idle +Setting your info +Getting other users' info +Telling the server who's on your permit/deny lists (buggy) + +CURRENTLY UNSUPPORTED FEATURES +============================== +Warning users (libfaim's problem) +Chat (gaim's problem) +Getting users' away messages (libfaim's problem? doesn't work with TOC either) +Getting/setting dir info (libfaim's problem?) +Changing your password (gaim's problem?) +File transfer/IM images/voice chat/etc. (gaim's problem?) + +(If I assigned problems incorrectly, sorry.) + HOW TO HELP =========== So here's what you can do in order to help gaim use libfaim. There are basically @@ -60,7 +82,7 @@ 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 statically in oscar.c as gaim_sess and gaim_conn. For +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) { diff -r 2c5713cd9d8c -r f6e8ea29b24f src/dialogs.c --- a/src/dialogs.c Sat May 20 21:01:59 2000 +0000 +++ b/src/dialogs.c Sat May 20 23:00:20 2000 +0000 @@ -1337,14 +1337,13 @@ /* The dialog for the info requests */ /*------------------------------------------------------------------------*/ -void g_show_info(char *url) +void g_show_info_text(char *info) { GtkWidget *ok; GtkWidget *label; GtkWidget *text; GtkWidget *bbox; GtkWidget *sw; - char *url_text; struct info_dlg *b = g_new0(struct info_dlg, 1); @@ -1382,8 +1381,12 @@ aol_icon(b->window->window); gtk_widget_show_all(b->window); - url_text = grab_url(url); - gtk_html_append_text(GTK_HTML(b->text), url_text, 0); + gtk_html_append_text(GTK_HTML(b->text), info, 0); +} + +void g_show_info(char *url) { + char *url_text = grab_url(url); + g_show_info_text(url_text); g_free(url_text); } diff -r 2c5713cd9d8c -r f6e8ea29b24f src/gaim.h --- a/src/gaim.h Sat May 20 21:01:59 2000 +0000 +++ b/src/gaim.h Sat May 20 23:00:20 2000 +0000 @@ -337,7 +337,7 @@ #define TYPE_SIGNOFF 4 #define TYPE_KEEPALIVE 5 -#define REVISION "gaim:$Revision: 252 $" +#define REVISION "gaim:$Revision: 257 $" #define FLAPON "FLAPON\r\n\r\n" #define ROAST "Tic/Toc" @@ -661,6 +661,7 @@ extern void show_find_email(); extern void show_find_info(); extern void g_show_info (char *); +extern void g_show_info_text (char *); extern void show_register_dialog(); extern void show_set_info(); extern void show_set_dir(); diff -r 2c5713cd9d8c -r f6e8ea29b24f src/oscar.c --- a/src/oscar.c Sat May 20 21:01:59 2000 +0000 +++ b/src/oscar.c Sat May 20 23:00:20 2000 +0000 @@ -509,41 +509,27 @@ struct command_rx_struct *command, ...) { struct aim_userinfo_s *info; char *prof_enc = NULL, *prof = NULL; + char buf[BUF_LONG]; + va_list ap; - va_list ap; va_start(ap, command); info = va_arg(ap, struct aim_userinfo_s *); prof_enc = va_arg(ap, char *); prof = va_arg(ap, char *); va_end(ap); - sprintf(debug_buff, "userinfo: sn: %s\n", info->sn); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: warnings: %d\n", info->warnlevel); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: class: "); - debug_print(debug_buff); - if (info->class & 0x0001) - debug_print("TRIAL "); - if (info->class & 0x0002) - debug_print("HUH? "); - if (info->class & 0x0004) - debug_print("AOL "); - if (info->class & 0x0008) - debug_print("HUH? "); - if (info->class & 0x0010) - debug_print("FREE"); - debug_print("\n"); - sprintf(debug_buff, "userinfo: member since: %lu\n", info->membersince); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: online since: %lu\n", info->onlinesince); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: idle time: %d\n", info->idletime); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: profile encoding: %s\n", prof_enc ? - prof_enc : "[none]"); - debug_print(debug_buff); - sprintf(debug_buff, "userinfo: profile: %s\n", prof ? prof : "[none]"); - debug_print(debug_buff); + + snprintf(buf, sizeof buf, "Username : %s\n
" + "Warning Level : %d %%\n
" + "Online Since : %s
" + "Idle Minutes : %d\n


" + "%s\n", + info->sn, + info->warnlevel, + asctime(localtime(&info->onlinesince)), + info->idletime, + prof); + g_show_info_text(buf); + return 1; } diff -r 2c5713cd9d8c -r f6e8ea29b24f src/server.c --- a/src/server.c Sat May 20 21:01:59 2000 +0000 +++ b/src/server.c Sat May 20 23:00:20 2000 +0000 @@ -311,6 +311,8 @@ #ifndef USE_OSCAR g_snprintf(buf, sizeof(buf), "toc_add_permit %s", normalize(name)); sflap_send(buf, -1, TYPE_DATA); +#else + serv_set_permit_deny(); #endif } @@ -322,6 +324,8 @@ #ifndef USE_OSCAR g_snprintf(buf, sizeof(buf), "toc_add_deny %s", normalize(name)); sflap_send(buf, -1, TYPE_DATA); +#else + serv_set_permit_deny(); #endif } @@ -361,6 +365,22 @@ } buf[at] = 0; sflap_send(buf, -1, TYPE_DATA); +#else + /* oscar requires us to do everyone at once (?) */ + list = permit; at = 0; + while (list) { + at += g_snprintf(&buf[at], sizeof(buf) - at, "%s&", list->data); + list = list->next; + } + aim_bos_changevisibility(gaim_sess, gaim_conn, + AIM_VISIBILITYCHANGE_PERMITADD, buf); + list = deny; at = 0; + while (list) { + at += g_snprintf(&buf[at], sizeof(buf) - at, "%s&", list->data); + list = list->next; + } + aim_bos_changevisibility(gaim_sess, gaim_conn, + AIM_VISIBILITYCHANGE_DENYADD, buf); #endif }