static void fetion_contact_list_dup_states (TpBaseContactList *contact_list, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request) { FetionContactList *self = FETION_CONTACT_LIST (contact_list); FetionConnection *conn = FETION_CONNECTION (self->priv->conn); HybridAccount* account = conn->priv->account; HybridBuddy* buddy = hybrid_blist_find_buddy_by_handle(account,contact); if(buddy != NULL && hybrid_blist_get_buddy_authorized(buddy)) { if (subscribe != NULL) *subscribe = TP_SUBSCRIPTION_STATE_YES ; if (publish != NULL) *publish = TP_SUBSCRIPTION_STATE_YES; }else { if (subscribe != NULL) *subscribe = TP_SUBSCRIPTION_STATE_NO ; if (publish != NULL) *publish = TP_SUBSCRIPTION_STATE_NO; } }
static gboolean fx_chat_start(HybridAccount *account, HybridBuddy *buddy) { fetion_account *ac; ac = hybrid_account_get_protocol_data(account); if (!hybrid_blist_get_buddy_authorized(buddy)) { hybrid_message_box_show(HYBRID_MESSAGE_WARNING, "This buddy hasn't been authorized, you can't\n" "start a chat with him."); return FALSE; } return TRUE; }