[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.26,1.27 workwi
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.26,1.27 workwizu.h,1.6,1.7 |
Date: |
Fri, 31 Jan 2003 11:55:18 -0500 |
Update of /cvsroot/ayttm/ayttm/modules/workwizu
In directory subversions:/tmp/cvs-serv3970
Modified Files:
workwizu.c workwizu.h
Log Message:
typing fixes
Index: workwizu.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/workwizu/workwizu.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- workwizu.c 31 Jan 2003 16:06:57 -0000 1.26
+++ workwizu.c 31 Jan 2003 16:55:16 -0000 1.27
@@ -98,6 +98,8 @@
int connstate;
+static int reset_typing (gpointer sockp);
+
/* Module Exports */
PLUGIN_INFO plugin_info = {
PLUGIN_SERVICE,
@@ -456,6 +458,12 @@
eb_workwizu_logout(account);
return;
}
+ if (strncmp(line, my_user->username,
strlen(my_user->username))) {
+ eb_debug(DBG_WWZ, "got normal packet before
auth result :(\n");
+ parse_packet(line);
+ free(line);
+ return;
+ }
parse_user_info(line);
if (my_user->is_driver)
send_my_packet (sock,
@@ -465,7 +473,7 @@
free(line);
my_user->statssender =
- eb_timeout_add (10000,
+ eb_timeout_add (10*60*1000, /* 10
minutes */
(eb_timeout_function)send_stats,
GINT_TO_POINTER(sock));
break;
case CONN_ESTABLISHED:
@@ -610,6 +618,8 @@
strcpy(my_user->username, account->handle);
strcpy(my_user->password, wad->password);
+ my_user->typing_handler = -1;
+
eb_debug(DBG_WWZ, "Logging in\n");
wad->sock = connect_socket(server, atoi(port));
if (wad->sock == -1) {
@@ -696,6 +706,8 @@
wwz_user *user = (wwz_user *)account_to->protocol_account_data;
char *send = translate_to_br(message);
+ reset_typing(GINT_TO_POINTER(wad->sock));
+
if (!my_user->has_speak)
do_error_dialog(_("You aren't allowed to speak.\nThis message
has probably not arrived."),
_("Workwizu Error"));
@@ -710,7 +722,9 @@
wwz_account_data *wad = (wwz_account_data
*)account_from->protocol_local_account_data;
my_user->is_typing = 1;
send_stats(GINT_TO_POINTER(wad->sock));
- my_user->is_typing = 0;
+ if (my_user->typing_handler != -1)
+ eb_timeout_remove(my_user->typing_handler);
+ my_user->typing_handler = eb_timeout_add(5000,
(eb_timeout_function)reset_typing, GINT_TO_POINTER(wad->sock));
return 4;
}
@@ -720,6 +734,13 @@
return eb_workwizu_send_typing(account_from, NULL);
}
+static int reset_typing (gpointer sockp) {
+ my_user->is_typing = 0;
+ send_stats(sockp);
+ my_user->typing_handler = -1;
+ return 0;
+}
+
eb_local_account *eb_workwizu_read_local_config (LList *values)
{
eb_local_account *ela;
@@ -780,6 +801,9 @@
ea->icon_handler = -1;
ea->status_handler = -1;
user->uid = atoi(ea->handle);
+
+ user->typing_handler = -1;
+
ea->protocol_account_data = user;
eb_debug(DBG_WWZ,"eb_workwizu_read_config for %s\n",ea->handle);
return ea;
@@ -856,6 +880,9 @@
ea->service_id = SERVICE_INFO.protocol_id;
ea->online = FALSE;
user->uid = atoi(ea->handle);
+
+ user->typing_handler = -1;
+
ea->protocol_account_data = user;
eb_debug(DBG_WWZ,"eb_workwizu_new_account for %s\n",ea->handle);
return ea;
@@ -893,6 +920,7 @@
do_error_dialog(_("You aren't allowed to speak.\nThis message
has probably not arrived."),
_("Workwizu Error"));
else {
+ reset_typing(GINT_TO_POINTER(wad->sock));
send_my_packet(wad->sock, CHAT, EXCEPTME, send); /*CHANNEL or
EXCEPTME*/
eb_chat_room_show_message(room, my_user->username, send);
}
Index: workwizu.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/workwizu/workwizu.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- workwizu.h 31 Jan 2003 16:06:58 -0000 1.6
+++ workwizu.h 31 Jan 2003 16:55:16 -0000 1.7
@@ -54,6 +54,7 @@
int has_speak;
int is_typing;
int statssender;
+ int typing_handler;
};
typedef enum
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.26,1.27 workwizu.h,1.6,1.7,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/modules/workwizu Makefile.am,1.5,1.6 workwizu.c,1.25,1.26 workwizu.h,1.5,1.6
- Next by Date:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.27,1.28
- Previous by thread:
[Ayttm-commits] CVS: ayttm/modules/workwizu Makefile.am,1.5,1.6 workwizu.c,1.25,1.26 workwizu.h,1.5,1.6
- Next by thread:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.27,1.28
- Index(es):