comparison src/away.c @ 4359:5fb47ec9bfe4

[gaim-migrate @ 4625] Wow, okay, where to begin with this one ;) I rewrote the whole conversation backend. It is now core/UI split. Here's how it works.. Every conversation is represented by a gaim_conversation structure. This branches out into gaim_im and gaim_chat structures. Every conversation lives in (well, normally, but it doesn't have to) a gaim_window structure. This is a _CORE_ representation of a window. There can be multiple gaim_window structures around. The gaim_window and gaim_conversation structures have UI-specific operation structures associated with them. At the moment, the only UI is GTK+, and this will be for some time. Don't start thinking you can write a QT UI now. It's just not going to happen. Everything that is done on a conversation is done through the core API. This API does core processing and then calls the UI operations for the rendering and anything else. Now, what does this give the user? - Multiple windows. - Multiple tabs per window. - Draggable tabs. - Send As menu is moved to the menubar. - Menubar for chats. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. For developers: - Fully documented API - Core/UI split - Variable checking and mostly sane handling of incorrect variables. - Logical structure to conversations, both core and UI. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. - Oh yeah, and the beginning of a stock icon system. Now, there are things that aren't there yet. You will see tabs even if you have them turned off. This will be fixed in time. Also, the preferences will change to work with the new structure. I'm starting school in 2 days, so it may not be done immediately, but hopefully in the next week. Enjoy! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 20 Jan 2003 09:10:23 +0000
parents 906f61f27479
children 8067614e49e4
comparison
equal deleted inserted replaced
4358:2b8abf7f9cc1 4359:5fb47ec9bfe4
55 55
56 void purge_away_queue(GSList **queue) 56 void purge_away_queue(GSList **queue)
57 { 57 {
58 GSList *q = *queue; 58 GSList *q = *queue;
59 struct queued_message *qm; 59 struct queued_message *qm;
60 struct conversation *cnv; 60 struct gaim_conversation *cnv;
61 61
62 while (q) { 62 while (q) {
63 qm = q->data; 63 qm = q->data;
64 64
65 cnv = find_conversation(qm->name); 65 cnv = gaim_find_conversation(qm->name);
66
66 if (!cnv) 67 if (!cnv)
67 cnv = new_conversation(qm->name); 68 cnv = gaim_conversation_new(GAIM_CONV_IM, qm->name);
68 69
69 if (g_slist_index(connections, qm->gc) >= 0) 70 if (g_slist_index(connections, qm->gc) >= 0)
70 set_convo_gc(cnv, qm->gc); 71 gaim_conversation_set_user(cnv, qm->gc->user);
71 72
72 write_to_conv(cnv, qm->message, qm->flags, NULL, qm->tm, qm->len); 73 gaim_im_write(GAIM_IM(cnv), NULL, qm->message, -1, qm->flags, qm->tm);
73 74
74 g_free(qm->message); 75 g_free(qm->message);
75 g_free(qm); 76 g_free(qm);
76 77
77 q->data = NULL; 78 q->data = NULL;
84 85
85 void dequeue_by_buddy(GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data) { 86 void dequeue_by_buddy(GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data) {
86 char *temp; 87 char *temp;
87 char *name; 88 char *name;
88 GSList *templist; 89 GSList *templist;
89 struct conversation *cnv; 90 struct gaim_conversation *cnv;
90 91
91 if(!(event->type == GDK_2BUTTON_PRESS && event->button == 1)) 92 if(!(event->type == GDK_2BUTTON_PRESS && event->button == 1))
92 return; /* Double clicking on the clist will unqueue that users messages. */ 93 return; /* Double clicking on the clist will unqueue that users messages. */
93 94
94 gtk_clist_get_text(GTK_CLIST(clist), row, 0, &temp); 95 gtk_clist_get_text(GTK_CLIST(clist), row, 0, &temp);
100 templist = message_queue; 101 templist = message_queue;
101 while (templist) { 102 while (templist) {
102 struct queued_message *qm = templist->data; 103 struct queued_message *qm = templist->data;
103 if (templist->data) { 104 if (templist->data) {
104 if (!g_strcasecmp(qm->name, name)) { 105 if (!g_strcasecmp(qm->name, name)) {
105 cnv = find_conversation(name); 106 cnv = gaim_find_conversation(name);
107
106 if (!cnv) 108 if (!cnv)
107 cnv = new_conversation(qm->name); 109 cnv = gaim_conversation_new(GAIM_CONV_IM, qm->name);
110
108 if (g_slist_index(connections, qm->gc) >= 0) 111 if (g_slist_index(connections, qm->gc) >= 0)
109 set_convo_gc(cnv, qm->gc); 112 gaim_conversation_set_user(cnv, qm->gc->user);
110 113
111 write_to_conv(cnv, qm->message, qm->flags, NULL, qm->tm, qm->len); 114 gaim_conversation_write(cnv, NULL, qm->message, qm->len,
115 qm->flags, qm->tm);
112 g_free(qm->message); 116 g_free(qm->message);
113 g_free(qm); 117 g_free(qm);
114 templist = message_queue = g_slist_remove(message_queue, qm); 118 templist = message_queue = g_slist_remove(message_queue, qm);
115 119
116 } else { 120 } else {