[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/aim-oscar Makefile.am,1.4,1.5 aim-os
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/aim-oscar Makefile.am,1.4,1.5 aim-oscar.c,1.11,1.12 |
Date: |
Wed, 19 Mar 2003 05:38:22 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/aim-oscar
In directory subversions:/tmp/cvs-serv9818/modules/aim-oscar
Modified Files:
Makefile.am aim-oscar.c
Log Message:
some fixes to aim-oscar
Index: Makefile.am
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/aim-oscar/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile.am 19 Jan 2003 14:00:18 -0000 1.4
+++ Makefile.am 19 Mar 2003 10:38:19 -0000 1.5
@@ -1,7 +1,7 @@
SUBDIRS = libfaim
libdir = $(pkgdatadir)/modules
-AM_CFLAGS = $(GTKCFLAGS)
+AM_CFLAGS = $(GTKCFLAGS) -Ilibfaim
lib_LTLIBRARIES = aim-oscar.la
aim_oscar_la_SOURCES = aim-oscar.c
Index: aim-oscar.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/aim-oscar/aim-oscar.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- aim-oscar.c 17 Mar 2003 14:44:49 -0000 1.11
+++ aim-oscar.c 19 Mar 2003 10:38:19 -0000 1.12
@@ -44,8 +44,9 @@
#endif
#include "info_window.h"
#include "aim.h"
-#include "gtk_eb_html.h"
+#include "gtk/gtk_eb_html.h"
#include "service.h"
+#include "llist.h"
#include "chat_window.h"
#include "chat_room.h"
#include "util.h"
@@ -108,7 +109,7 @@
* End Module Code
************************************************************************************/
-static GList * aim_buddies = NULL;
+static LList * aim_buddies = NULL;
struct eb_aim_account_data
{
gint idle_time;
@@ -185,7 +186,7 @@
eb_local_account *aim_find_local_account_by_conn(struct aim_conn_t * conn)
{
- GList * node;
+ LList * node;
for (node = accounts; node; node = node->next)
{
@@ -346,7 +347,7 @@
buddy_login(user);
for(i = 0; i < 45; i++ )
{
- //aad->idle_time = *((int*)(&command->data[43]));
+ //aad->idle_time = *((int*)(&command->data[43]));
aad->idle_time = info->idletime;
aad->evil = info->warnlevel;
buddy_update_status(user);
@@ -426,7 +427,7 @@
char buff[1024];
FILE *fp;
int i = 0;
- GList * node;
+ LList * node;
eb_local_account * account = aim_find_local_account_by_conn(command->conn );
struct eb_aim_local_account_data *alad =
account->protocol_local_account_data;
@@ -708,7 +709,7 @@
int eb_aim_msg_error(struct aim_session_t * sess,struct command_rx_struct
*command, ...)
{
- do_message_dialog("Last message could not be sent", "AIM: Error");
+ do_error_dialog("Last message could not be sent", "AIM: Error");
return 1;
}
@@ -881,7 +882,7 @@
ecr->connected = FALSE;
ecr->fellows = NULL;
- ecr->protocol_local_chat_room_data = (void *) roominfo->exchange;
+ ecr->protocol_local_chat_room_data = (void *) ((int)roominfo->exchange);
ecr->local_user = ela;
@@ -1015,7 +1016,7 @@
return aad->status != AIM_OFFLINE;
}
-eb_account * eb_aim_new_account( gchar * account )
+eb_account * eb_aim_new_account( const char * account )
{
eb_account * a = g_new0(eb_account, 1);
struct eb_aim_account_data * aad = g_new0(struct eb_aim_account_data,
1);
@@ -1030,9 +1031,9 @@
void eb_aim_del_user( eb_account * account )
{
- GList * node;
+ LList * node;
assert( eb_services[account->service_id].protocol_id ==
SERVICE_INFO.protocol_id );
- aim_buddies = g_list_remove(aim_buddies, account->handle );
+ aim_buddies = l_list_remove(aim_buddies, account->handle );
for( node = accounts; node; node=node->next )
{
eb_local_account * ela = node->data;
@@ -1046,11 +1047,11 @@
void eb_aim_add_user( eb_account * account )
{
- GList * node;
+ LList * node;
assert( eb_services[account->service_id].protocol_id ==
SERVICE_INFO.protocol_id );
- if(!g_list_find(aim_buddies, account->handle))
- aim_buddies = g_list_append(aim_buddies, account->handle);
+ if(!l_list_find(aim_buddies, account->handle))
+ aim_buddies = l_list_append(aim_buddies, account->handle);
for( node = accounts; node; node=node->next )
{
eb_local_account * ela = node->data;
@@ -1070,26 +1071,14 @@
if (message) {
if(account->status_menu)
{
- gtk_check_menu_item_set_active
- (
- GTK_CHECK_MENU_ITEM
- (
- g_slist_nth(account->status_menu,
AIM_AWAY)->data
- ), TRUE
- );
+ eb_set_active_menu_status(account->status_menu,
AIM_AWAY);
}
aim_bos_setprofile(&(alad->aimsess), alad->conn, profile, message,
AIM_CAPS_CHAT);
} else {
if(account->status_menu)
{
- gtk_check_menu_item_set_active
- (
- GTK_CHECK_MENU_ITEM
- (
- g_slist_nth(account->status_menu,
AIM_ONLINE)->data
- ), TRUE
- );
+ eb_set_active_menu_status(account->status_menu,
AIM_ONLINE);
}
aim_bos_setprofile(&(alad->aimsess), alad->conn, profile, NULL,
AIM_CAPS_CHAT);
@@ -1099,10 +1088,10 @@
void eb_aim_login( eb_local_account * account )
{
struct eb_aim_local_account_data * alad;
- account->connected = 1;
alad = (struct eb_aim_local_account_data
*)account->protocol_local_account_data;
+ if (account->connected==-1) return;
ref_count++;
fprintf(stderr, "eb_aim_login: Incrementing ref_count to %i\n",
ref_count);
aim_session_init(&alad->aimsess, 0); // AIM_SESS_FLAGS_NONBLOCKCONNECT
@@ -1152,6 +1141,14 @@
aim_conn_addhandler(&(alad->aimsess), alad->conn, AIM_CB_FAM_GEN,
AIM_CB_GEN_SERVERREADY, eb_aim_serverready, 0 );
#endif
+ account->connected = 1;
+ printf("Connected %p!!!\n",account->status_menu);
+ if(account->status_menu)
+ {
+ /* Make sure set_current_state doesn't call us back */
+ account->connected=-1;
+ eb_set_active_menu_status(account->status_menu, AIM_ONLINE);
+ }
alad->input = eb_input_add(alad->conn->fd,
EB_INPUT_READ|EB_INPUT_EXCEPTION , eb_aim_callback, account);
// alad->timer = eb_timeout_add(100, aim_poll_server, &(alad->aimsess));
@@ -1164,17 +1161,11 @@
struct eb_aim_local_account_data * alad;
alad = (struct eb_aim_local_account_data
*)account->protocol_local_account_data;
eb_input_remove(alad->input);
-// eb_timeout_remove(alad->timer);
aim_conn_kill(&(alad->aimsess), &(alad->conn));
alad->status=AIM_OFFLINE;
ref_count--;
fprintf(stderr, "eb_aim_logout: Decrementing ref_count to %i\n",
ref_count);
-/*
- gtk_widget_destroy(account->status_button);
- account->status_button = MakeStatusButton(account);
- gtk_widget_show(account->status_button);
-
gtk_container_add(GTK_CONTAINER(account->status_frame),account->status_button);
-*/
+
account->connected = 0;
}
@@ -1215,53 +1206,28 @@
}
-GList * eb_aim_write_local_config ( eb_local_account * account )
+LList * eb_aim_write_local_config ( eb_local_account * account )
{
struct eb_aim_local_account_data * ala =
account->protocol_local_account_data;
- GList * list = NULL;
+ LList * list = NULL;
value_pair * vp;
vp = g_new0( value_pair, 1 );
strcpy( vp->key, "SCREEN_NAME" );
- strcpy( vp->value, ala->aimsess.logininfo.screen_name );
+ strcpy( vp->value, account->handle );
- list = g_list_append( list, vp );
+ list = l_list_append( list, vp );
vp = g_new0( value_pair, 1 );
strcpy( vp->key, "PASSWORD" );
strcpy( vp->value, ala->password );
- list = g_list_append( list, vp );
+ list = l_list_append( list, vp );
return list;
}
-#if 0
-GList * eb_aim_write_local_config( eb_local_account * account )
-{
- struct eb_aim_local_account_data * alad =
account->protocol_local_account_data;
- GList * list = NULL;
- value_pair * vp;
-
-
- vp = g_new0(value_pair, 1);
- strcpy(vp->key, "SCREEN_NAME");
- strcpy(vp->value, account->handle );
-
- list = g_list_append( list, vp );
-
- vp = g_new0(value_pair, 1);
- strcpy(vp->value, alad->password);
- strcpy(vp->key, "PASSWORD");
-
-
- list = g_list_append(list, vp);
-
- return list;
-}
-#endif
-
-eb_local_account * eb_aim_read_local_config(GList * pairs)
+eb_local_account * eb_aim_read_local_config(LList * pairs)
{
eb_local_account * ela = g_new0(eb_local_account, 1);
@@ -1280,7 +1246,7 @@
}
-eb_account * eb_aim_read_config( GList * config, struct contact *contact )
+eb_account * eb_aim_read_config( LList * config, struct contact *contact )
{
eb_account * ea = g_new0(eb_account, 1 );
struct eb_aim_account_data * aad = g_new0(struct eb_aim_account_data,1);
@@ -1306,12 +1272,12 @@
}
-GList * eb_aim_get_states()
+LList * eb_aim_get_states()
{
- GList * states = NULL;
- states = g_list_append(states, "Online");
- states = g_list_append(states, "Away");
- states = g_list_append(states, "Offline");
+ LList * states = NULL;
+ states = l_list_append(states, "Online");
+ states = l_list_append(states, "Away");
+ states = l_list_append(states, "Offline");
return states;
}
@@ -1343,12 +1309,10 @@
if(alad->status == AIM_OFFLINE && state != AIM_OFFLINE )
{
eb_aim_login(account);
- account->connected = 1;
}
else if(alad->status != AIM_OFFLINE && state == AIM_OFFLINE )
{
eb_aim_logout(account);
- account->connected = 0;
}
}
@@ -1357,41 +1321,16 @@
return NULL;
}
-static gint pixmaps = 0;
-static GdkPixmap * eb_aim_pixmap[AIM_OFFLINE+1];
-static GdkBitmap * eb_aim_bitmap[AIM_OFFLINE+1];
-
-void eb_aim_init_pixmaps()
-{
- gint i;
- gchar ** xpm;
-
- for (i=AIM_ONLINE; i<=AIM_OFFLINE; i++) {
- switch(i) {
- case AIM_AWAY:
- xpm = aim_away_xpm;
- break;
- default:
- xpm = aim_online_xpm;
- break;
- }
- eb_aim_pixmap[i] =
gdk_pixmap_create_from_xpm_d(statuswindow->window,
- &eb_aim_bitmap[i], NULL, xpm);
- }
- pixmaps = 1;
-}
-
-void eb_aim_get_status_pixmap( eb_account * account, GdkPixmap ** pm,
GdkBitmap ** bm )
+char **eb_aim_get_status_pixmap( eb_account * account)
{
struct eb_aim_account_data * aad;
- if (!pixmaps)
- eb_aim_init_pixmaps();
-
aad = account->protocol_account_data;
- *pm = eb_aim_pixmap[aad->status];
- *bm = eb_aim_bitmap[aad->status];
+ if (aad->status == AIM_AWAY)
+ return aim_away_xpm;
+ else
+ return aim_online_xpm;
}
gchar * eb_aim_get_status_string( eb_account * account )
{
@@ -1718,7 +1657,7 @@
#endif
- ecr->protocol_local_chat_room_data = (void *) roominfo->exchange;
+ ecr->protocol_local_chat_room_data = (void *) ((int)roominfo->exchange);
if (roomname)
{
strcpy(ecr->room_name, roomname);
@@ -1794,7 +1733,7 @@
#endif
aim_chat_invite(&alad->aimsess, alad->conn, user, message,
- (gint) room->protocol_local_chat_room_data,
+ (int) room->protocol_local_chat_room_data,
room->id, 0);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/aim-oscar Makefile.am,1.4,1.5 aim-oscar.c,1.11,1.12,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.347,1.348 configure.in,1.342,1.343
- Next by Date:
[Ayttm-commits] CVS: ayttm/src info_window.h,1.6,1.7
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.347,1.348 configure.in,1.342,1.343
- Next by thread:
[Ayttm-commits] CVS: ayttm/src info_window.h,1.6,1.7
- Index(es):