changeset 4608:5fcb44d771d2

[gaim-migrate @ 4896] just because an account signs off doesn't mean we can forget about it ;-) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 24 Feb 2003 00:29:54 +0000
parents 8742023570be
children 71b27122c8a6
files plugins/idle.c src/away.c src/buddy.c src/conversation.c src/gtkconv.c src/idle.c src/protocols/gg/gg.c src/protocols/icq/gaim_icq.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/napster/napster.c src/protocols/oscar/oscar.c src/protocols/yahoo/yahoo.c src/server.c src/ui.h
diffstat 15 files changed, 41 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/idle.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/plugins/idle.c	Mon Feb 24 00:29:54 2003 +0000
@@ -9,8 +9,8 @@
 #define GAIM_PLUGINS
 #endif
 
+#include "gaim.h"
 #include "multi.h"
-#include "gaim.h"
 #include <sys/time.h>
 
 static struct gaim_connection *gc = NULL;
--- a/src/away.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/away.c	Mon Feb 24 00:29:54 2003 +0000
@@ -74,8 +74,8 @@
 			if (!g_strcasecmp(qm->name, name)) {
 				struct gaim_account *account = NULL;
 
-				if (g_slist_index(connections, qm->gc) >= 0)
-					account = qm->gc->account;
+				if (g_slist_index(gaim_accounts, qm->account) >= 0)
+					account = qm->account;
 
 				cnv = gaim_find_conversation(name);
 
@@ -114,8 +114,8 @@
 
 		account = NULL;
 
-		if (g_slist_index(connections, qm->gc) >= 0)
-			account = qm->gc->account;
+		if (g_slist_index(gaim_accounts, qm->account) >= 0)
+			account = qm->account;
 
 		cnv = gaim_find_conversation(qm->name);
 
--- a/src/buddy.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/buddy.c	Mon Feb 24 00:29:54 2003 +0000
@@ -952,28 +952,6 @@
 	update_idle_times();
 }
 
-void
-reset_convo_gcs()
-{
-	GList *l;
-	struct gaim_conversation *c;
-
-	for (l = gaim_get_ims(); l != NULL; l = l->next) {
-		c = (struct gaim_conversation *)l->data;
-
-		if (!g_slist_find(connections, gaim_conversation_get_gc(c))) {
-			struct gaim_account *account;
-
-			if (connections == NULL)
-				account = ((struct gaim_connection *)connections->data)->account;
-			else
-				account = NULL;
-
-			gaim_conversation_set_account(c, account);
-		}
-	}
-}
-
 static void edit_tree_move(GtkCTree *ctree, GtkCTreeNode *child,
 						   GtkCTreeNode *parent, GtkCTreeNode *sibling,
 						   gpointer data)
@@ -2242,7 +2220,7 @@
 					g_snprintf(qm->name, sizeof(qm->name), "%s", b->name);
 					qm->message = g_strdup_printf(_("%s logged in."),
 							get_buddy_alias(b));
-					qm->gc = gc;
+					qm->account = gc->account;
 					qm->tm = time(NULL);
 					qm->flags = WFLAG_SYSTEM;
 					qm->len = -1;
@@ -2305,7 +2283,7 @@
 						get_buddy_alias(b));
 				qm->message = g_strdup_printf(_("%s logged out."),
 						get_buddy_alias(b));
-				qm->gc = gc;
+				qm->account = gc->account;
 				qm->tm = time(NULL);
 				qm->flags = WFLAG_SYSTEM;
 				qm->len = -1;
--- a/src/conversation.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/conversation.c	Mon Feb 24 00:29:54 2003 +0000
@@ -1373,7 +1373,7 @@
 						const char *message, size_t length, int flags,
 						time_t mtime)
 {
-	struct gaim_connection *gc;
+	struct gaim_account *account;
 	struct gaim_conversation_ui_ops *ops;
 	struct gaim_window *win;
 	struct buddy *b;
@@ -1388,10 +1388,10 @@
 	if (ops == NULL || ops->write_conv == NULL)
 		return;
 
-	gc = gaim_conversation_get_gc(conv);
+	account = gaim_conversation_get_account(conv);
 
 	if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT &&
-		(gc == NULL || !g_slist_find(gc->buddy_chats, conv)))
+		(account->gc == NULL || !g_slist_find(account->gc->buddy_chats, conv)))
 		return;
 
 	if (gaim_conversation_get_type(conv) == GAIM_CONV_IM &&
@@ -1399,23 +1399,23 @@
 		return;
 
 	if (gaim_conversation_get_type(conv) == GAIM_CONV_IM ||
-		!(gc->prpl->options & OPT_PROTO_UNIQUE_CHATNAME)) {
+		!(account->gc->prpl->options & OPT_PROTO_UNIQUE_CHATNAME)) {
 
 		if (who == NULL) {
-			if ((flags & WFLAG_SEND) == WFLAG_SEND) {
-				b = find_buddy(gc->account, gc->username);
+			if ((flags & WFLAG_SEND)) {
+				b = find_buddy(account, account->gc->username);
 
 				if (b != NULL && strcmp(b->name, get_buddy_alias(b)))
 					who = get_buddy_alias(b);
-				else if (*gc->account->alias)
-					who = gc->account->alias;
-				else if (*gc->displayname)
-					who = gc->displayname;
+				else if (*account->alias)
+					who = account->alias;
+				else if (*account->gc->displayname)
+					who = account->gc->displayname;
 				else
-					who = gc->username;
+					who = account->gc->username;
 			}
 			else {
-				b = find_buddy(gc->account, gaim_conversation_get_name(conv));
+				b = find_buddy(account, gaim_conversation_get_name(conv));
 
 				if (b != NULL)
 					who = get_buddy_alias(b);
@@ -1424,7 +1424,7 @@
 			}
 		}
 		else {
-			b = find_buddy(gc->account, who);
+			b = find_buddy(account, who);
 
 			if (b != NULL)
 				who = get_buddy_alias(b);
--- a/src/gtkconv.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/gtkconv.c	Mon Feb 24 00:29:54 2003 +0000
@@ -2508,7 +2508,7 @@
 	/* Now, um, just kind of all over the place. Huh? */
 
 	/* Add button */
-	if (find_buddy(gaim_conversation_get_gc(conv)->account,
+	if (find_buddy(gaim_conversation_get_account(conv),
 				   gaim_conversation_get_name(conv)) == NULL) {
 		gtkim->add = gaim_gtk_change_text(_("Add"), gtkim->add,
 										  GTK_STOCK_ADD, type);
@@ -3852,8 +3852,11 @@
 
 		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, -1, 0);
 
-		with_font_tag = g_strdup_printf("<font sml=\"%s\">%s</font>",
+		if(gc)
+			with_font_tag = g_strdup_printf("<font sml=\"%s\">%s</font>",
 										gc->prpl->name, new_message);
+		else
+			with_font_tag = g_strdup(new_message);
 
 		log_str = gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml),
 										 with_font_tag, length,
--- a/src/idle.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/idle.c	Mon Feb 24 00:29:54 2003 +0000
@@ -37,8 +37,8 @@
 #endif
 #endif /* USE_SCREENSAVER */
 
+#include "gaim.h"
 #include "multi.h"
-#include "gaim.h"
 #include "prpl.h"
 
 #define IDLEMARK 600   	/* 10 minutes! */
--- a/src/protocols/gg/gg.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/gg/gg.c	Mon Feb 24 00:29:54 2003 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 4894 2003-02-23 02:21:17Z lschiere $
+ * $Id: gg.c 4896 2003-02-24 00:29:54Z faceprint $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -44,10 +44,10 @@
 #include <ctype.h>
 /* Library from EKG (Eksperymentalny Klient Gadu-Gadu) */
 #include "libgg.h"
+#include "gaim.h"
 #include "multi.h"
 #include "core.h"
 #include "prpl.h"
-#include "gaim.h"
 #include "proxy.h"
 
 #ifdef _WIN32
--- a/src/protocols/icq/gaim_icq.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/icq/gaim_icq.c	Mon Feb 24 00:29:54 2003 +0000
@@ -1,9 +1,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include "icq.h"   /* well, we're doing ICQ, right? */
+#include "gaim.h"  /* needed for every other damn thing */
 #include "multi.h" /* needed for gaim_connection */
 #include "prpl.h"  /* needed for prpl */
-#include "gaim.h"  /* needed for every other damn thing */
 #include "proxy.h"
 
 #include "pixmaps/protocols/icq/gnomeicu-online.xpm"
--- a/src/protocols/irc/irc.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/irc/irc.c	Mon Feb 24 00:29:54 2003 +0000
@@ -40,10 +40,10 @@
 #include <time.h>
 #include <sys/stat.h>
 #include <ctype.h>
+#include "gaim.h"
 #include "multi.h"
 #include "core.h"
 #include "prpl.h"
-#include "gaim.h"
 #include "proxy.h"
 
 #ifdef _WIN32
--- a/src/protocols/jabber/jabber.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Feb 24 00:29:54 2003 +0000
@@ -44,9 +44,9 @@
 #include <stdio.h>
 #include <time.h>
 #include <sys/stat.h>
+#include "gaim.h"
 #include "multi.h"
 #include "prpl.h"
-#include "gaim.h"
 #ifdef MAX
 #undef MAX
 #endif
--- a/src/protocols/napster/napster.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/napster/napster.c	Mon Feb 24 00:29:54 2003 +0000
@@ -38,9 +38,9 @@
 #include <stdio.h>
 #include <time.h>
 #include <sys/stat.h>
+#include "gaim.h"
 #include "multi.h"
 #include "prpl.h"
-#include "gaim.h"
 #include "proxy.h"
 
 #ifdef _WIN32
--- a/src/protocols/oscar/oscar.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Feb 24 00:29:54 2003 +0000
@@ -44,9 +44,9 @@
 #include <sys/stat.h>
 #include <signal.h>
 
+#include "gaim.h"
 #include "multi.h"
 #include "prpl.h"
-#include "gaim.h"
 #include "core.h"
 #include "aim.h"
 #include "proxy.h"
--- a/src/protocols/yahoo/yahoo.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Feb 24 00:29:54 2003 +0000
@@ -41,9 +41,9 @@
 #include <time.h>
 #include <sys/stat.h>
 #include <ctype.h>
+#include "gaim.h"
 #include "multi.h"
 #include "prpl.h"
-#include "gaim.h"
 #include "proxy.h"
 #include "md5.h"
 
--- a/src/server.c	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/server.c	Mon Feb 24 00:29:54 2003 +0000
@@ -686,7 +686,7 @@
 			qm = g_new0(struct queued_message, 1);
 				g_snprintf(qm->name, sizeof(qm->name), "%s", name);
 			qm->message = g_memdup(message, len == -1 ? strlen(message) + 1 : len);
-			qm->gc = gc;
+			qm->account = gc->account;
 			qm->tm = mtime;
 			qm->flags = WFLAG_RECV | away;
 			qm->len = len;
@@ -790,7 +790,7 @@
 			qm = g_new0(struct queued_message, 1);
 			g_snprintf(qm->name, sizeof(qm->name), "%s", name);
 			qm->message = g_strdup(away_subs(tmpmsg, alias));
-			qm->gc = gc;
+			qm->account = gc->account;
 			qm->tm = mtime;
 			qm->flags = WFLAG_SEND | WFLAG_AUTO;
 			qm->len = -1;
@@ -818,7 +818,7 @@
 			qm = g_new0(struct queued_message, 1);
 			g_snprintf(qm->name, sizeof(qm->name), "%s", name);
 			qm->message = g_strdup(message);
-			qm->gc = gc;
+			qm->account = gc->account;
 			qm->tm = mtime;
 			qm->flags = away | WFLAG_RECV;
 			qm->len = len;
--- a/src/ui.h	Sun Feb 23 06:24:00 2003 +0000
+++ b/src/ui.h	Mon Feb 24 00:29:54 2003 +0000
@@ -29,6 +29,8 @@
 #include <gtk/gtk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
+#include "core.h"
+#include "multi.h"
 #include "gtkconv.h"
 #include "gtkft.h"
 #include "gtkutils.h"
@@ -230,11 +232,12 @@
 
 /* this is used for queuing messages received while away. This is really a UI function
  * which is why the struct is here. */
+
 struct queued_message {
 	char name[80];
 	char *message;
 	time_t tm;
-	struct gaim_connection *gc;
+	struct gaim_account *account;
 	int flags;
 	int len;
 };