[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.7,1.8
From: |
Philip S Tellis <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.7,1.8 |
Date: |
Tue, 28 Jan 2003 01:20:08 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/irc
In directory subversions:/tmp/cvs-serv30500/modules/irc
Modified Files:
irc.c
Log Message:
get_status_pixmap in irc and jabber
Index: irc.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/irc/irc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- irc.c 27 Jan 2003 13:48:19 -0000 1.7
+++ irc.c 28 Jan 2003 06:20:05 -0000 1.8
@@ -50,7 +50,7 @@
#include "status.h"
#include "message_parse.h"
#include "info_window.h"
-#include "gtk_eb_html.h"
+#include "gtk/gtk_eb_html.h"
#include "plugin_api.h"
#include "smileys.h"
@@ -135,10 +135,10 @@
char password[255];
char port[10];
int fd;
- gint fd_tag;
- gint keepalive_tag;
+ int fd_tag;
+ int keepalive_tag;
GString * buff;
- gint status;
+ int status;
LList * friends;
} irc_local_account;
@@ -146,8 +146,8 @@
{
char server[255];
char realserver[255];
- gint status;
- gint idle;
+ int status;
+ int idle;
} irc_account;
typedef struct _irc_info
@@ -182,40 +182,40 @@
/* Local prototypes */
static unsigned char *strip_color (unsigned char *text);
static int sendall(int s, char *buf, int len);
- static gboolean irc_query_connected (eb_account * account);
- static void irc_parse_incoming_message (eb_local_account * ela,
gchar *buff);
- static void irc_parse (eb_local_account * ela, gchar *buff);
+ static int irc_query_connected (eb_account * account);
+ static void irc_parse_incoming_message (eb_local_account * ela, char
*buff);
+ static void irc_parse (eb_local_account * ela, char *buff);
static void irc_callback (void *data, int source, eb_input_condition
condition);
static void irc_ask_after_users ( eb_local_account * account );
- static gint irc_keep_alive( gpointer data );
+ static int irc_keep_alive( gpointer data );
static void irc_login( eb_local_account * account);
static void irc_logout( eb_local_account * ela );
- static void irc_send_im( eb_local_account * account_from, eb_account
* account_to,gchar *message );
+ static void irc_send_im( eb_local_account * account_from, eb_account
* account_to,char *message );
static eb_local_account * irc_read_local_config(LList * pairs);
static LList * irc_write_local_config( eb_local_account * account );
static eb_account * irc_read_config(LList *config, struct contact *contact);
static LList * irc_get_states();
- static gint irc_get_current_state(eb_local_account * account );
- static void irc_set_current_state(eb_local_account * account, gint
state );
+ static int irc_get_current_state(eb_local_account * account );
+ static void irc_set_current_state(eb_local_account * account, int
state );
static char * irc_check_login(char * user, char * pass);
static void irc_add_user( eb_account * account );
static void irc_del_user( eb_account * account );
- static gboolean irc_is_suitable (eb_local_account *local, eb_account
*remote);
- static eb_account * irc_new_account( gchar * account );
- static gchar * irc_get_status_string( eb_account * account );
+ static int irc_is_suitable (eb_local_account *local, eb_account *remote);
+ static eb_account * irc_new_account( char * account );
+ static char * irc_get_status_string( eb_account * account );
static void irc_init_pixmaps();
- static void irc_get_status_pixmap( eb_account * account, GdkPixmap
** pm, GdkBitmap ** bm );
- static void irc_set_idle(eb_local_account * account, gint idle );
- static void irc_set_away( eb_local_account * account, gchar *
message);
+ static char ** irc_get_status_pixmap( eb_account * account);
+ static void irc_set_idle(eb_local_account * account, int idle );
+ static void irc_set_away( eb_local_account * account, char *
message);
static void irc_send_file( eb_local_account * from, eb_account * to,
char * file );
static void irc_info_update(info_window * iw);
static void irc_info_data_cleanup(info_window * iw);
static void irc_get_info( eb_local_account * account_from,
eb_account * account_to);
static void irc_join_chat_room(eb_chat_room *room);
static void irc_leave_chat_room(eb_chat_room *room);
- static void irc_send_chat_room_message(eb_chat_room *room, gchar
*message);
- static void irc_send_invite( eb_local_account * account,
eb_chat_room * room, gchar * user, gchar * message);
-static eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account *
account);
+ static void irc_send_chat_room_message(eb_chat_room *room, char
*message);
+ static void irc_send_invite( eb_local_account * account,
eb_chat_room * room, char * user, char * message);
+static eb_chat_room * irc_make_chat_room(char * name, eb_local_account *
account);
static void irc_accept_invite( eb_local_account * account, void *
invitation );
static void irc_decline_invite( eb_local_account * account, void *
invitation );
static void eb_irc_read_prefs_config(LList * values);
@@ -315,7 +315,7 @@
return n==-1?-1:total; // return -1 on failure, bytes sent on success
}
-static gboolean irc_query_connected (eb_account * account)
+static int irc_query_connected (eb_account * account)
{
irc_account * ia = NULL;
@@ -328,10 +328,10 @@
/* Handle a message-to-be-read here ... CTCP ACTION, PRIVMSG and NOTICE */
-static void irc_parse_incoming_message (eb_local_account * ela, gchar *buff)
+static void irc_parse_incoming_message (eb_local_account * ela, char *buff)
{
irc_local_account * ila = (irc_local_account *)
ela->protocol_local_account_data;
- gchar **buff2;
+ char **buff2;
int is_nickserv = 0;
eb_account *ea = NULL;
irc_account *ia = NULL;
@@ -452,11 +452,11 @@
/* The main IRC protocol parser */
-static void irc_parse (eb_local_account * ela, gchar *buff)
+static void irc_parse (eb_local_account * ela, char *buff)
{
irc_local_account * ila = (irc_local_account *)
ela->protocol_local_account_data;
- gchar **buff2;
- gchar **split_buff;
+ char **buff2;
+ char **split_buff;
eb_account *ea = NULL;
irc_account *ia = NULL;
int ret = 0;
@@ -543,7 +543,7 @@
}
if (ea->infowindow != NULL )
{
- gchar **priv_split_buff = g_strsplit(buff, " ",
3);
+ char **priv_split_buff = g_strsplit(buff, " ",
3);
irc_info *ii = (irc_info
*)ea->infowindow->info_data;
if (ii->whois_info != NULL) {
free(ii->whois_info); }
@@ -726,7 +726,7 @@
ecr = (eb_chat_room*)node->data;
if (ecr && ecr->service_id == SERVICE_INFO.protocol_id
)
{
- gchar ** buff3 = g_strsplit(ecr->id, "@", 2);
+ char ** buff3 = g_strsplit(ecr->id, "@", 2);
if(!strcmp(buff3[1], ila->server)
&& eb_chat_room_buddy_connected(ecr,
nick))
{
@@ -785,7 +785,7 @@
ecr = (eb_chat_room*)node->data;
if (ecr && ecr->service_id == SERVICE_INFO.protocol_id
)
{
- gchar ** buff3 = g_strsplit(ecr->id, "@", 2);
+ char ** buff3 = g_strsplit(ecr->id, "@", 2);
if(!strcmp(buff3[1], ila->server)
&&
eb_chat_room_buddy_connected(ecr, nick))
{
@@ -966,7 +966,7 @@
static int i = 0;
int firstread = 1;
char c;
- static gchar buff[BUF_LEN];
+ static char buff[BUF_LEN];
if ((source == ila->fd) && (buff != NULL))
{
@@ -1054,7 +1054,7 @@
eb_account * ea = NULL;
irc_account * ia = NULL;
LList * node;
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
char *nick = NULL;
char *alpha = NULL;
int ret = 0;
@@ -1090,7 +1090,7 @@
/* Called once a minute, checks whether buddies still are online */
-static gint irc_keep_alive( gpointer data )
+static int irc_keep_alive( gpointer data )
{
eb_local_account * ela = (eb_local_account *) data;
@@ -1103,7 +1103,7 @@
{
irc_local_account * ila = (irc_local_account *)
account->protocol_local_account_data;
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
struct hostent *host;
struct sockaddr_in site;
int i;
@@ -1176,7 +1176,7 @@
irc_local_account * ila = (irc_local_account *)
ela->protocol_local_account_data;
LList * node;
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
eb_account * ea = NULL;
irc_account *ia = NULL;
@@ -1220,10 +1220,10 @@
static void irc_send_im( eb_local_account * account_from,
eb_account * account_to,
- gchar *message )
+ char *message )
{
irc_local_account * ila = (irc_local_account *)
account_from->protocol_local_account_data;
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
char *nick = NULL;
char *alpha = NULL;
int ret = 0;
@@ -1327,7 +1327,7 @@
{
eb_account * ea = g_new0(eb_account, 1 );
irc_account * ia = g_new0(irc_account, 1);
- gchar *temp = NULL;
+ char *temp = NULL;
LList * node;
ea->protocol_account_data = ia;
@@ -1393,14 +1393,14 @@
}
-static gint irc_get_current_state(eb_local_account * account )
+static int irc_get_current_state(eb_local_account * account )
{
irc_local_account * ila = (irc_local_account *)
account->protocol_local_account_data;
return ila->status;
}
-static void irc_set_current_state(eb_local_account * account, gint state )
+static void irc_set_current_state(eb_local_account * account, int state )
{
irc_local_account * ila = (irc_local_account *)
account->protocol_local_account_data;
@@ -1469,7 +1469,7 @@
return;
}
-static gboolean irc_is_suitable (eb_local_account *local, eb_account *remote)
+static int irc_is_suitable (eb_local_account *local, eb_account *remote)
{
irc_account *ia = (irc_account *)remote->protocol_account_data;
irc_local_account *ila = (irc_local_account
*)local->protocol_local_account_data;
@@ -1501,7 +1501,7 @@
/* This func expects account names of the form address@hidden,
for example address@hidden, and will return
NULL otherwise, very probably causing a crash. */
-static eb_account * irc_new_account( gchar * account )
+static eb_account * irc_new_account( char * account )
{
eb_account * ea = g_new0(eb_account, 1);
irc_account * ia = g_new0(irc_account, 1);
@@ -1550,11 +1550,11 @@
return ea;
}
-static gchar * irc_get_status_string( eb_account * account )
+static char * irc_get_status_string( eb_account * account )
{
irc_account * ia = (irc_account *) account->protocol_account_data;
- static gchar string[255];
- static gchar buf[255];
+ static char string[255];
+ static char buf[255];
strcpy(string, "");
strcpy(buf, "");
@@ -1589,14 +1589,14 @@
return string;
}
-static gint pixmaps = 0;
+static int pixmaps = 0;
static GdkPixmap * eb_irc_pixmap[IRC_OFFLINE+1];
static GdkBitmap * eb_irc_bitmap[IRC_OFFLINE+1];
static void irc_init_pixmaps()
{
- gint i;
- gchar ** xpm;
+ int i;
+ char ** xpm;
for (i=IRC_ONLINE; i<=IRC_OFFLINE; i++) {
switch(i)
@@ -1615,27 +1615,28 @@
return;
}
-static void irc_get_status_pixmap( eb_account * account, GdkPixmap ** pm,
GdkBitmap ** bm )
+static char ** irc_get_status_pixmap( eb_account * account)
{
irc_account * ia;
- if (!pixmaps)
- irc_init_pixmaps();
+ /*if (!pixmaps)
+ irc_init_pixmaps();*/
ia = account->protocol_account_data;
- *pm = eb_irc_pixmap[ia->status];
- *bm = eb_irc_bitmap[ia->status];
- return;
+ if (ia->status == IRC_ONLINE)
+ return irc_online_xpm;
+ else
+ return irc_away_xpm;
}
/* Not needed with IRC, the server detects our idleness */
-static void irc_set_idle(eb_local_account * account, gint idle )
+static void irc_set_idle(eb_local_account * account, int idle )
{
return;
}
-static void irc_set_away( eb_local_account * account, gchar * message)
+static void irc_set_away( eb_local_account * account, char * message)
{
irc_local_account *ila = (irc_local_account
*)account->protocol_local_account_data;
char buf[BUF_LEN];
@@ -1674,8 +1675,8 @@
static void irc_info_update(info_window * iw)
{
- gchar message[BUF_LEN*4];
- gchar temp[BUF_LEN];
+ char message[BUF_LEN*4];
+ char temp[BUF_LEN];
char *alpha = NULL;
char *freeme = NULL;
irc_info *ii = (irc_info *)iw->info_data;
@@ -1730,7 +1731,7 @@
{
char *nick;
char *alpha;
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
irc_local_account * ila =
(irc_local_account *) account_from->protocol_local_account_data;
@@ -1773,7 +1774,7 @@
static void irc_join_chat_room(eb_chat_room *room)
{
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
signed int ret;
irc_local_account * ila = (irc_local_account *)
room->chat_room_account->protocol_local_account_data;
@@ -1786,7 +1787,7 @@
static void irc_leave_chat_room(eb_chat_room *room)
{
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
signed int ret;
irc_local_account * ila = (irc_local_account *)
room->chat_room_account->protocol_local_account_data;
@@ -1797,9 +1798,9 @@
return;
}
-static void irc_send_chat_room_message(eb_chat_room *room, gchar *message)
+static void irc_send_chat_room_message(eb_chat_room *room, char *message)
{
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
char nick[255];
char *alpha;
signed int ret;
@@ -1820,9 +1821,9 @@
}
static void irc_send_invite( eb_local_account * account, eb_chat_room * room,
- gchar * user, gchar * message)
+ char * user, char * message)
{
- gchar buff[BUF_LEN];
+ char buff[BUF_LEN];
signed int ret;
irc_local_account * ila = (irc_local_account *)
room->chat_room_account->protocol_local_account_data;
@@ -1848,7 +1849,7 @@
return;
}
-static eb_chat_room * irc_make_chat_room(gchar * name, eb_local_account *
account)
+static eb_chat_room * irc_make_chat_room(char * name, eb_local_account *
account)
{
LList * node;
eb_chat_room * ecr;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/irc irc.c,1.7,1.8,
Philip S Tellis <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.231,1.232 configure.in,1.227,1.228
- Next by Date:
[Ayttm-commits] CVS: ayttm/modules/sms sms.c,1.5,1.6
- Previous by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.231,1.232 configure.in,1.227,1.228
- Next by thread:
[Ayttm-commits] CVS: ayttm/modules/sms sms.c,1.5,1.6
- Index(es):