changeset 1040:17cea517fd90

[gaim-migrate @ 1050] if a new protocol wants to be loaded, load it. nothing wrong with that. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 01 Nov 2000 09:07:17 +0000
parents 67ed2ee5be9f
children ab8ef0fc1417
files src/dialogs.c src/prpl.c
diffstat 2 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Tue Oct 31 19:34:57 2000 +0000
+++ b/src/dialogs.c	Wed Nov 01 09:07:17 2000 +0000
@@ -3278,6 +3278,7 @@
         gtk_widget_show(label);
         gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
         gtk_box_pack_start(GTK_BOX(topbox), aliasentry, FALSE, FALSE, 5);
+	gtk_entry_set_editable(GTK_ENTRY(aliasentry), FALSE);
 	label = gtk_label_new(_("Alias"));
 	gtk_widget_show(label);
         gtk_box_pack_start(GTK_BOX(topbox), label, FALSE, FALSE, 5);
--- a/src/prpl.c	Tue Oct 31 19:34:57 2000 +0000
+++ b/src/prpl.c	Wed Nov 01 09:07:17 2000 +0000
@@ -44,11 +44,28 @@
 void load_protocol(proto_init pi)
 {
 	struct prpl *p = g_new0(struct prpl, 1);
+	struct prpl *old;
 	pi(p);
-	if (find_prpl(p->protocol))
-		g_free(p);
-	else
-		protocols = g_slist_append(protocols, p);
+	if (old = find_prpl(p->protocol)) {
+		GSList *c = connections;
+		struct gaim_connection *g;
+		while (c) {
+			g = (struct gaim_connection *)c->data;
+			if (g->prpl == old) {
+				char buf[256];
+				g_snprintf(buf, sizeof buf, _("%s was using %s, which got replaced."
+								" %s is now offline."), g->username,
+								(*p->name)(), g->username);
+				do_error_dialog(buf, _("Disconnect"));
+				signoff(g);
+				c = connections;
+			} else
+				c = c->next;
+		}
+		protocols = g_slist_remove(protocols, old);
+		g_free(old);
+	}
+	protocols = g_slist_append(protocols, p);
 }
 
 void static_proto_init()