# HG changeset patch # User Christopher O'Brien # Date 1133312685 0 # Node ID 0e467757b57a3dce39bf225c4d1e6067f0258322 # Parent f82b6d559ea781e28d99a28899c7d4e6fc222410 [gaim-migrate @ 14568] setting up buddy subscriptions and user status at login committer: Tailor Script diff -r f82b6d559ea7 -r 0e467757b57a src/protocols/sametime/sametime.c --- a/src/protocols/sametime/sametime.c Tue Nov 29 23:59:36 2005 +0000 +++ b/src/protocols/sametime/sametime.c Wed Nov 30 01:04:45 2005 +0000 @@ -1325,6 +1325,38 @@ } +/* lifted this from oldstatus, since HEAD doesn't do this at login + anymore. */ +static void blist_init(GaimAccount *acct) { + GaimBlistNode *gnode, *cnode, *bnode; + GList *add_buds = NULL; + + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(! GAIM_BLIST_NODE_IS_GROUP(gnode)) continue; + + for(cnode = gnode->child; cnode; cnode = cnode->next) { + if(! GAIM_BLIST_NODE_IS_CONTACT(cnode)) + continue; + for(bnode = cnode->child; bnode; bnode = bnode->next) { + GaimBuddy *b; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + + b = (GaimBuddy *)bnode; + if(b->account == acct) { + add_buds = g_list_append(add_buds, b); + } + } + } + } + + if(add_buds) { + gaim_account_add_buddies(acct, add_buds); + g_list_free(add_buds); + } +} + + /** Last thing to happen from a started session */ static void services_starting(struct mwGaimPluginData *pd) { @@ -1392,6 +1424,8 @@ /* ... but we can do file transfers! */ mwServiceAware_setAttributeBoolean(pd->srvc_aware, mwAttribute_FILE_TRANSFER, TRUE); + + blist_init(acct); } @@ -1415,12 +1449,19 @@ } +static void mw_prpl_set_status(GaimAccount *acct, GaimStatus *status); + + /** called from mw_session_stateChange when the session's state is mwSession_STARTED. Any finalizing of start-up stuff should go here */ static void session_started(struct mwGaimPluginData *pd) { - - /* XXX setup status */ + GaimStatus *status; + GaimAccount *acct; + + acct = gaim_connection_get_account(pd->gc); + status = gaim_account_get_active_status(acct); + mw_prpl_set_status(acct, status); /* use our services to do neat things */ services_starting(pd);