can_add_contact_to_account (McAccount *account,
gpointer user_data)
{
- EmpathyContactManager *mgr;
- gboolean result;
+ EmpathyContactManager *mgr;
+ gboolean result;
- mgr = empathy_contact_manager_new ();
- result = empathy_contact_manager_can_add (mgr, account);
- g_object_unref (mgr);
+ mgr = empathy_contact_manager_new ();
+ result = empathy_contact_manager_can_add (mgr, account);
+ g_object_unref (mgr);
- return result;
+ return result;
}
static void
gboolean
empathy_contact_manager_can_add (EmpathyContactManager *manager,
- McAccount *account)
+ McAccount *account)
{
EmpathyContactManagerPriv *priv = GET_PRIV (manager);
- EmpathyTpContactList *list;
+ EmpathyTpContactList *list;
g_return_val_if_fail (EMPATHY_IS_CONTACT_MANAGER (manager), FALSE);
- list = g_hash_table_lookup (priv->lists, account);
- if (list == NULL)
- return FALSE;
+ list = g_hash_table_lookup (priv->lists, account);
+ if (list == NULL)
+ return FALSE;
return empathy_tp_contact_list_can_add (list);
}
+
EmpathyContactManager *empathy_contact_manager_new (void);
EmpathyTpContactList * empathy_contact_manager_get_list (EmpathyContactManager *manager,
McAccount *account);
-gboolean empathy_contact_manager_can_add (EmpathyContactManager *manager,
+gboolean empathy_contact_manager_can_add (EmpathyContactManager *manager,
McAccount *account);
G_END_DECLS
empathy_tp_contact_list_can_add (EmpathyTpContactList *list)
{
EmpathyTpContactListPriv *priv;
- TpChannelGroupFlags flags;
+ TpChannelGroupFlags flags;
g_return_val_if_fail (EMPATHY_IS_TP_CONTACT_LIST (list), FALSE);
priv = GET_PRIV (list);
- if (priv->subscribe == NULL)
- return FALSE;
+ if (priv->subscribe == NULL)
+ return FALSE;
- flags = empathy_tp_group_get_flags (priv->subscribe);
+ flags = empathy_tp_group_get_flags (priv->subscribe);
return (flags & TP_CHANNEL_GROUP_FLAG_CAN_ADD) != 0;
}
GType empathy_tp_contact_list_get_type (void) G_GNUC_CONST;
EmpathyTpContactList * empathy_tp_contact_list_new (McAccount *account);
McAccount * empathy_tp_contact_list_get_account (EmpathyTpContactList *list);
-gboolean empathy_tp_contact_list_can_add (EmpathyTpContactList *list);
+gboolean empathy_tp_contact_list_can_add (EmpathyTpContactList *list);
G_END_DECLS
#include <libmissioncontrol/mc-account.h>
-#include <telepathy-glib/channel.h>
#include <telepathy-glib/util.h>
#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/channel.h>
#include "empathy-tp-group.h"
#include "empathy-contact-factory.h"
TpChannelGroupFlags
empathy_tp_group_get_flags (EmpathyTpGroup *self)
{
- EmpathyTpGroupPriv *priv = GET_PRIV (self);
+ EmpathyTpGroupPriv *priv = GET_PRIV (self);
- if (priv->channel == NULL)
- return 0;
+ g_return_val_if_fail (EMPATHY_IS_TP_GROUP (self), 0);
- return tp_channel_group_get_flags (priv->channel);
+ if (priv->channel == NULL)
+ return 0;
+
+ return tp_channel_group_get_flags (priv->channel);
}
EmpathyContact *actor,
const gchar *message);
void empathy_pending_info_free (EmpathyPendingInfo *info);
-TpChannelGroupFlags empathy_tp_group_get_flags (EmpathyTpGroup *group);
+TpChannelGroupFlags empathy_tp_group_get_flags (EmpathyTpGroup *group);
G_END_DECLS