#include "empathy-tp-contact-list.h"
#include "empathy-contact-list.h"
#include "empathy-tp-group.h"
-#include "empathy-debug.h"
#include "empathy-utils.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_TP | EMPATHY_DEBUG_CONTACT
+#include "empathy-debug.h"
+
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
EMPATHY_TYPE_TP_CONTACT_LIST, EmpathyTpContactListPriv))
-#define DEBUG_DOMAIN "TpContactList"
-
struct _EmpathyTpContactListPriv {
McAccount *account;
TpConnection *connection;
{
EmpathyTpContactListPriv *priv = GET_PRIV (list);
- empathy_debug (DEBUG_DOMAIN, "Group destroyed: %s",
- empathy_tp_group_get_name (group));
+ DEBUG ("Group destroyed: %s", empathy_tp_group_get_name (group));
priv->groups = g_list_remove (priv->groups, group);
g_object_unref (group);
group_name = empathy_tp_group_get_name (group);
if (!g_list_find_custom (*groups, group_name, (GCompareFunc) strcmp)) {
- empathy_debug (DEBUG_DOMAIN, "Contact %s (%d) added to group %s",
- empathy_contact_get_id (contact),
- empathy_contact_get_handle (contact),
- group_name);
+ DEBUG ("Contact %s (%d) added to group %s",
+ empathy_contact_get_id (contact),
+ empathy_contact_get_handle (contact),
+ group_name);
*groups = g_list_prepend (*groups, g_strdup (group_name));
g_signal_emit_by_name (list, "groups-changed", contact,
group_name,
group_name = empathy_tp_group_get_name (group);
if ((l = g_list_find_custom (*groups, group_name, (GCompareFunc) strcmp))) {
- empathy_debug (DEBUG_DOMAIN, "Contact %s (%d) removed from group %s",
- empathy_contact_get_id (contact),
- empathy_contact_get_handle (contact),
- group_name);
+ DEBUG ("Contact %s (%d) removed from group %s",
+ empathy_contact_get_id (contact),
+ empathy_contact_get_handle (contact),
+ group_name);
*groups = g_list_delete_link (*groups, l);
g_signal_emit_by_name (list, "groups-changed", contact,
group_name,
TpContactListType list_type;
list_type = tp_contact_list_get_type (list, group);
- empathy_debug (DEBUG_DOMAIN, "Contact %s (%d) added to list type %d",
- empathy_contact_get_id (contact),
- empathy_contact_get_handle (contact),
- list_type);
+ DEBUG ("Contact %s (%d) added to list type %d",
+ empathy_contact_get_id (contact),
+ empathy_contact_get_handle (contact),
+ list_type);
/* We now get the presence of that contact, add it to members */
if (list_type == TP_CONTACT_LIST_TYPE_SUBSCRIBE &&
TpContactListType list_type;
list_type = tp_contact_list_get_type (list, group);
- empathy_debug (DEBUG_DOMAIN, "Contact %s (%d) removed from list type %d",
- empathy_contact_get_id (contact),
- empathy_contact_get_handle (contact),
- list_type);
+ DEBUG ("Contact %s (%d) removed from list type %d",
+ empathy_contact_get_id (contact),
+ empathy_contact_get_handle (contact),
+ list_type);
/* This contact refuses to send us his presence, remove from members. */
if (list_type == TP_CONTACT_LIST_TYPE_SUBSCRIBE &&
TpContactListType list_type;
list_type = tp_contact_list_get_type (list, group);
- empathy_debug (DEBUG_DOMAIN, "Contact %s (%d) pending in list type %d",
- empathy_contact_get_id (contact),
- empathy_contact_get_handle (contact),
- list_type);
+ DEBUG ("Contact %s (%d) pending in list type %d",
+ empathy_contact_get_id (contact),
+ empathy_contact_get_handle (contact),
+ list_type);
/* We want this contact in our contact list but we don't get its
* presence yet. Add to members anyway. */
EmpathyTpContactListPriv *priv = GET_PRIV (list);
GList *l;
- empathy_debug (DEBUG_DOMAIN, "Connection invalidated");
+ DEBUG ("Connection invalidated");
/* Remove all contacts */
for (l = priv->members; l; l = l->next) {
}
g_list_free (contacts);
} else {
- empathy_debug (DEBUG_DOMAIN,
- "Type of contact list channel unknown "
- "or aleady have that list: %s",
- empathy_tp_group_get_name (group));
+ DEBUG ("Type of contact list channel unknown or aleady "
+ "have that list: %s",
+ empathy_tp_group_get_name (group));
goto OUT;
}
- empathy_debug (DEBUG_DOMAIN,
- "New contact list channel of type: %d",
- list_type);
+ DEBUG ("New contact list channel of type: %d", list_type);
g_signal_connect (group, "member-added",
G_CALLBACK (tp_contact_list_added_cb),
goto OUT;
}
- empathy_debug (DEBUG_DOMAIN, "New server-side group channel: %s",
- group_name);
+ DEBUG ("New server-side group channel: %s", group_name);
priv->groups = g_list_prepend (priv->groups, g_object_ref (group));
}
g_list_free (contacts);
} else {
- empathy_debug (DEBUG_DOMAIN,
- "Unknown handle type (%d) for contact list channel",
- handle_type);
+ DEBUG ("Unknown handle type (%d) for contact list channel",
+ handle_type);
}
OUT:
guint i;
if (error) {
- empathy_debug (DEBUG_DOMAIN,
- "Failed to get list of open channels: %s",
- error ? error->message : "No error given");
+ DEBUG ("Failed to get list of open channels: %s",
+ error ? error->message : "No error given");
return;
}
list = EMPATHY_TP_CONTACT_LIST (object);
priv = GET_PRIV (list);
- empathy_debug (DEBUG_DOMAIN, "finalize: %p", object);
+ DEBUG ("finalize: %p", object);
if (priv->subscribe) {
g_object_unref (priv->subscribe);
return tp_group;
}
- empathy_debug (DEBUG_DOMAIN, "creating new group: %s", group);
+ DEBUG ("creating new group: %s", group);
if (!tp_cli_connection_run_request_handles (priv->connection, -1,
TP_HANDLE_TYPE_GROUP,
names,
&handles,
&error, NULL)) {
- empathy_debug (DEBUG_DOMAIN,
- "Failed to RequestHandles: %s",
- error ? error->message : "No error given");
+ DEBUG ("Failed to RequestHandles: %s",
+ error ? error->message : "No error given");
g_clear_error (&error);
return NULL;
}
TRUE,
&object_path,
&error, NULL)) {
- empathy_debug (DEBUG_DOMAIN,
- "Failed to RequestChannel: %s",
- error ? error->message : "No error given");
+ DEBUG ("Failed to RequestChannel: %s",
+ error ? error->message : "No error given");
g_clear_error (&error);
return NULL;
}
return;
}
- empathy_debug (DEBUG_DOMAIN, "rename group %s to %s", old_group, new_group);
+ DEBUG ("rename group %s to %s", old_group, new_group);
/* Remove all members from the old group */
members = empathy_tp_group_get_members (tp_group);
return;
}
- empathy_debug (DEBUG_DOMAIN, "remove group %s", group);
+ DEBUG ("remove group %s", group);
/* Remove all members of the group */
members = empathy_tp_group_get_members (tp_group);