Mercurial > pidgin
diff src/prpl.c @ 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 | 91b7377e7b45 |
children | 1528d05b3e6b |
line wrap: on
line diff
--- 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()