[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.21,1.22 chat_room.h,1.6,1.7
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.21,1.22 chat_room.h,1.6,1.7 message_parse.c,1.7,1.8 util.c,1.8,1.9 util.h,1.2,1.3 |
Date: |
Mon, 13 Jan 2003 02:23:31 -0500 |
Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv13513/src
Modified Files:
chat_room.c chat_room.h message_parse.c util.c util.h
Log Message:
Diplay typing status in chatrooms
Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- chat_room.c 13 Jan 2003 05:45:58 -0000 1.21
+++ chat_room.c 13 Jan 2003 07:23:27 -0000 1.22
@@ -615,9 +615,24 @@
}
else
{
-
+ GList *walk;
+ eb_account *acc = NULL;
g_snprintf(buff, 2048, "<FONT COLOR=\"#FF0000\"><B>%s:
</B></FONT>",
user);
+ for (walk = chat_room->typing_fellows; walk && walk->data; walk
= walk->next) {
+ acc = walk->data;
+ if (!strcmp(acc->handle, user)
+ || !strcmp(acc->account_contact->nick, user))
+ break;
+ else
+ acc = NULL;
+ }
+ if (acc && chat_room->typing_fellows) {
+ chat_room->typing_fellows =
g_list_remove(chat_room->typing_fellows,acc);
+ eb_chat_room_display_status (acc, NULL);
+ }
+
+
}
temp_message = eb_smilify(g_strdup(message),
RUN_SERVICE(chat_room->chat_room_account)->get_smileys());
link_message = linkify(temp_message);
@@ -912,6 +927,11 @@
GTK_SIGNAL_FUNC(destroy_chat_window),
chat_room);
+ chat_room->status_label = gtk_label_new(" ");
+ gtk_box_pack_start(GTK_BOX(hbox2), chat_room->status_label, FALSE,
FALSE, 0);
+ gtk_widget_show(chat_room->status_label);
+ chat_room->typing_fellows = NULL;
+
gtk_box_pack_end(GTK_BOX(hbox2), toolbar, FALSE, FALSE, 0);
gtk_widget_show(toolbar);
@@ -989,4 +1009,44 @@
node = node->next;
}
return newlist;
+}
+
+void eb_chat_room_display_status (eb_account *remote, char *message)
+{
+ GList *rooms = NULL, *walk = NULL;
+ if (!iGetLocalPref("do_typing_notify"))
+ return;
+
+ rooms = find_chatrooms_with_remote_account(remote);
+ for (walk = rooms; walk && walk->data; walk = walk->next) {
+ eb_chat_room *ecr = walk->data;
+ gchar *tmp = NULL;
+ gchar *typing = NULL, *typing_old = NULL;
+ GList *walk2 = NULL;
+ if (message && !strcmp(_("typing..."), message)) {
+ if (!ecr->typing_fellows ||
!g_list_find(ecr->typing_fellows, remote))
+ ecr->typing_fellows =
g_list_append(ecr->typing_fellows, remote);
+ } else if (ecr->typing_fellows) {
+ ecr->typing_fellows =
g_list_remove(ecr->typing_fellows, remote);
+ }
+
+ for (walk2 = ecr->typing_fellows; walk2 && walk2->data; walk2 =
walk2->next) {
+ eb_account *acc = walk2->data;
+ typing_old = typing;
+ typing = g_strdup_printf("%s%s%s",
+ acc->account_contact->nick,
+ typing_old?", ":"",
+ typing_old?typing_old:"");
+ g_free(typing_old);
+ }
+
+ if (typing != NULL && strlen(typing) > 0)
+ tmp = g_strdup_printf("%s: %s", typing, _("typing..."));
+ else
+ tmp = g_strdup_printf(" ");
+
+ if (ecr && ecr->status_label)
+ gtk_label_set_text( GTK_LABEL(ecr->status_label), tmp );
+ g_free(tmp);
+ }
}
Index: chat_room.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- chat_room.h 13 Jan 2003 04:58:32 -0000 1.6
+++ chat_room.h 13 Jan 2003 07:23:27 -0000 1.7
@@ -43,6 +43,8 @@
GtkWidget * online; // CList of online folks
GtkWidget *smiley_button;
GtkWidget *smiley_window;
+ GtkWidget * status_label;
+ GList *typing_fellows;
GList * history;
GList * hist_pos;
int this_msg_in_history;
@@ -82,6 +84,7 @@
gboolean eb_chat_room_buddy_connected( eb_chat_room * room, gchar * user );
void open_join_chat_window();
char* next_chatroom_name();
+void eb_chat_room_display_status (eb_account *remote, char *message);
#ifdef __cplusplus
} /* extern "C" */
Index: message_parse.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/message_parse.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- message_parse.c 4 Jan 2003 13:59:27 -0000 1.7
+++ message_parse.c 13 Jan 2003 07:23:27 -0000 1.8
@@ -467,4 +467,5 @@
gchar * message )
{
eb_chat_window_display_status( remote, message );
+ eb_chat_room_display_status(remote, message);
}
Index: util.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- util.c 13 Jan 2003 04:58:32 -0000 1.8
+++ util.c 13 Jan 2003 07:23:27 -0000 1.9
@@ -765,6 +765,28 @@
}
+GList * find_chatrooms_with_remote_account(eb_account *remote)
+{
+ GList * node = chat_rooms;
+ GList * result = NULL;
+ for (node = chat_rooms; node && node->data; node = node->next) {
+ eb_chat_room *ecr = node->data;
+ if (remote->service_id == ecr->service_id) {
+ GList *others = NULL;
+ gboolean found = FALSE;
+ for (others = ecr->fellows; others && others->data &&
!found; others=others->next) {
+ eb_chat_room_buddy *ecrb = others->data;
+ if(!strcmp(remote->handle, ecrb->handle)) {
+ found = TRUE;
+ result = g_list_append(result, ecr);
+ eb_debug(DBG_CORE, "Found %s in
%s\n",remote->handle, ecr->room_name);
+ }
+ }
+ }
+ }
+ return result;
+}
+
grouplist * find_grouplist_by_name(gchar * name)
{
GList * l1;
Index: util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util.h 3 Jan 2003 23:26:07 -0000 1.2
+++ util.h 13 Jan 2003 07:23:27 -0000 1.3
@@ -87,6 +87,7 @@
struct contact * rest );
eb_chat_room * find_chat_room_by_id( gchar * id );
eb_chat_room * find_chat_room_by_name( gchar * name, gint service_id );
+GList * find_chatrooms_with_remote_account(eb_account *remote);
grouplist * find_grouplist_by_nick(gchar * nick);
grouplist * find_grouplist_by_name(gchar * name);
struct contact * find_contact_by_handle( gchar * handle );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src chat_room.c,1.21,1.22 chat_room.h,1.6,1.7 message_parse.c,1.7,1.8 util.c,1.8,1.9 util.h,1.2,1.3,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.7,1.8
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.89,1.90 configure.in,1.87,1.88
- Previous by thread:
[Ayttm-commits] CVS: ayttm/modules/workwizu workwizu.c,1.7,1.8
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.89,1.90 configure.in,1.87,1.88
- Index(es):