Mercurial > pidgin
diff src/server.c @ 11643:eb14bbcf7249
[gaim-migrate @ 13920]
sf patch #1293063, from John Bailey
Move and rename some functions from server.c to the account API.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Wed, 12 Oct 2005 02:47:31 +0000 |
| parents | c4fde4165293 |
| children | bcc49c25ef90 |
line wrap: on
line diff
--- a/src/server.c Wed Oct 12 02:27:32 2005 +0000 +++ b/src/server.c Wed Oct 12 02:47:31 2005 +0000 @@ -209,111 +209,6 @@ } } -void serv_change_passwd(GaimConnection *gc, const char *orig, const char *new) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->change_passwd) - prpl_info->change_passwd(gc, orig, new); -} - -void serv_add_buddy(GaimConnection *gc, GaimBuddy *buddy) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->add_buddy) - prpl_info->add_buddy(gc, buddy, gaim_find_buddys_group(buddy)); -} - -void serv_add_buddies(GaimConnection *gc, GList *buddies) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc)) { - GList *cur, *groups = NULL; - - /* Make a list of what the groups each buddy is in */ - for (cur = buddies; cur != NULL; cur = cur->next) { - GaimBlistNode *node = cur->data; - groups = g_list_append(groups, node->parent->parent); - } - - if (prpl_info->add_buddies) - prpl_info->add_buddies(gc, buddies, groups); - else if (prpl_info->add_buddy) { - GList *curb = buddies; - GList *curg = groups; - while ((curb != NULL) && (curg != NULL)) { - prpl_info->add_buddy(gc, curb->data, curg->data); - curb = curb->next; - curg = curg->next; - } - } - - g_list_free(groups); - } -} - - -void serv_remove_buddy(GaimConnection *gc, GaimBuddy *buddy, GaimGroup *group) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && prpl_info->remove_buddy) - prpl_info->remove_buddy(gc, buddy, group); -} - -void serv_remove_buddies(GaimConnection *gc, GList *buddies, GList *groups) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (!g_list_find(gaim_connections_get_all(), gc)) - return; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc)) { - if (prpl_info->remove_buddies) { - prpl_info->remove_buddies(gc, buddies, groups); - } else { - GList *curb = buddies; - GList *curg = groups; - while ((curb != NULL) && (curg != NULL)) { - serv_remove_buddy(gc, curb->data, curg->data); - curb = curb->next; - curg = curg->next; - } - } - } -} - -void serv_remove_group(GaimConnection *gc, GaimGroup *group) -{ - GaimPluginProtocolInfo *prpl_info = NULL; - - if (gc != NULL && gc->prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); - - if (prpl_info && g_list_find(gaim_connections_get_all(), gc) && - prpl_info->remove_group) - { - prpl_info->remove_group(gc, group); - } -} - /* * Set buddy's alias on server roster/list */
