Mercurial > pidgin.yaz
comparison src/status.c @ 10176:0109f3a518d2
[gaim-migrate @ 11291]
A few small changes, and one big one. Setting a status on an account
correctly updates the prpl. A number of prpls are broken though. MSN seems
to work. OSCAR rate limits. :/
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 14 Nov 2004 19:25:23 +0000 |
parents | 0b43f6fef9b5 |
children | 760e690a5f30 |
comparison
equal
deleted
inserted
replaced
10175:53410b84336f | 10176:0109f3a518d2 |
---|---|
573 ops->update(gaim_get_blist(), (GaimBlistNode*)buddy); | 573 ops->update(gaim_get_blist(), (GaimBlistNode*)buddy); |
574 } | 574 } |
575 | 575 |
576 static void | 576 static void |
577 notify_status_update(GaimPresence *presence, GaimStatus *old_status, | 577 notify_status_update(GaimPresence *presence, GaimStatus *old_status, |
578 GaimStatus *new_status) | 578 GaimStatus *new_status) |
579 { | 579 { |
580 GaimPresenceContext context = gaim_presence_get_context(presence); | 580 GaimPresenceContext context = gaim_presence_get_context(presence); |
581 | 581 |
582 gaim_debug_info("notify_status_update", "Context is %d\n", context); | 582 gaim_debug_info("notify_status_update", "Context is %d\n", context); |
583 | 583 |
584 if (context == GAIM_PRESENCE_CONTEXT_ACCOUNT) | 584 if (context == GAIM_PRESENCE_CONTEXT_ACCOUNT) |
585 { | 585 { |
586 GaimAccount *account = gaim_presence_get_account(presence); | |
586 GaimAccountUiOps *ops = gaim_accounts_get_ui_ops(); | 587 GaimAccountUiOps *ops = gaim_accounts_get_ui_ops(); |
588 | |
589 if (gaim_account_is_connected(account)) | |
590 { | |
591 GaimPluginProtocolInfo *prpl_info = NULL; | |
592 GaimPlugin *prpl; | |
593 | |
594 prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); | |
595 | |
596 if (prpl != NULL) | |
597 { | |
598 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); | |
599 | |
600 if (prpl_info != NULL && prpl_info->set_status != NULL) | |
601 prpl_info->set_status(account, new_status); | |
602 } | |
603 } | |
587 | 604 |
588 if (ops != NULL && ops->status_changed != NULL) | 605 if (ops != NULL && ops->status_changed != NULL) |
589 { | 606 { |
590 ops->status_changed(gaim_presence_get_account(presence), | 607 ops->status_changed(account, new_status); |
591 new_status); | |
592 } | 608 } |
593 } | 609 } |
594 else if (context == GAIM_PRESENCE_CONTEXT_CONV) | 610 else if (context == GAIM_PRESENCE_CONTEXT_CONV) |
595 { | 611 { |
596 /* TODO */ | 612 /* TODO */ |
1564 return TRUE; | 1580 return TRUE; |
1565 else | 1581 else |
1566 return FALSE; | 1582 return FALSE; |
1567 } | 1583 } |
1568 | 1584 |
1585 const GList * | |
1586 gaim_statuses_get_stored(void) | |
1587 { | |
1588 return NULL; | |
1589 } | |
1590 | |
1591 GaimStatus * | |
1592 gaim_statuses_find_stored(const GaimStatusType *status_type, const char *id) | |
1593 { | |
1594 return NULL; | |
1595 } | |
1596 | |
1569 void * | 1597 void * |
1570 gaim_statuses_get_handle() { | 1598 gaim_statuses_get_handle() { |
1571 static int handle; | 1599 static int handle; |
1572 | 1600 |
1573 return &handle; | 1601 return &handle; |
1618 } | 1646 } |
1619 | 1647 |
1620 void | 1648 void |
1621 gaim_statuses_uninit(void) | 1649 gaim_statuses_uninit(void) |
1622 { | 1650 { |
1623 if(buddy_presences != NULL) | 1651 if (buddy_presences != NULL) |
1652 { | |
1624 g_hash_table_destroy(buddy_presences); | 1653 g_hash_table_destroy(buddy_presences); |
1625 buddy_presences = NULL; | 1654 |
1655 buddy_presences = NULL; | |
1656 } | |
1626 } | 1657 } |
1627 | 1658 |
1628 void | 1659 void |
1629 gaim_statuses_sync(void) | 1660 gaim_statuses_sync(void) |
1630 { | 1661 { |