EmpathyChatPriv *priv = GET_PRIV (chat);
EmpathyAccount *account;
- account = empathy_account_manager_get_account (manager, connection);
+ account = empathy_account_manager_get_account_for_connection (manager,
+ connection);
if (!priv->tp_chat && account == priv->account &&
priv->handle_type != TP_HANDLE_TYPE_NONE &&
!EMP_STR_EMPTY (priv->id)) {
priv->tp_chat = g_object_ref (tp_chat);
connection = empathy_tp_chat_get_connection (priv->tp_chat);
- priv->account = empathy_account_manager_get_account (priv->account_manager,
+ priv->account = empathy_account_manager_get_account_for_connection (
+ priv->account_manager,
connection);
g_object_ref (priv->account);
account_id = strv[0];
contact_id = strv[1];
account_manager = empathy_account_manager_dup_singleton ();
- account = empathy_account_manager_lookup (account_manager, account_id);
+ account = empathy_account_manager_get_account (account_manager, account_id);
if (account) {
TpConnection *connection;
}
EmpathyAccount *
-empathy_account_manager_get_account (EmpathyAccountManager *manager,
- TpConnection *connection)
+empathy_account_manager_get_account_for_connection (
+ EmpathyAccountManager *manager,
+ TpConnection *connection)
{
EmpathyAccountManagerPriv *priv;
GHashTableIter iter;
}
EmpathyAccount *
-empathy_account_manager_lookup (EmpathyAccountManager *manager,
+empathy_account_manager_get_account (EmpathyAccountManager *manager,
const gchar *unique_name)
{
EmpathyAccountManagerPriv *priv = GET_PRIV (manager);
- EmpathyAccount *account;
-
- account = g_hash_table_lookup (priv->accounts, unique_name);
- if (account != NULL)
- g_object_ref (account);
-
- return account;
+ return g_hash_table_lookup (priv->accounts, unique_name);
}
GList *
(EmpathyAccountManager *manager);
int empathy_account_manager_get_count
(EmpathyAccountManager *manager);
-EmpathyAccount * empathy_account_manager_get_account
+EmpathyAccount * empathy_account_manager_get_account_for_connection
(EmpathyAccountManager *manager,
TpConnection *connection);
-EmpathyAccount * empathy_account_manager_lookup
+EmpathyAccount * empathy_account_manager_get_account
(EmpathyAccountManager *manager,
const gchar *unique_name);
GList * empathy_account_manager_dup_accounts
xmlFree (str);
}
- account = empathy_account_manager_lookup (priv->account_manager, account_id);
+ account = empathy_account_manager_get_account (priv->account_manager,
+ account_id);
if (!account) {
g_free (name);
g_free (room);
add_chatroom (manager, chatroom);
g_signal_emit (manager, signals[CHATROOM_ADDED], 0, chatroom);
- g_object_unref (account);
g_free (name);
g_free (room);
g_free (account_id);
chat = EMPATHY_TP_CHAT (
empathy_dispatch_operation_get_channel_wrapper (operation));
connection = empathy_tp_chat_get_connection (chat);
- account = empathy_account_manager_get_account (priv->account_manager,
- connection);
+ account = empathy_account_manager_get_account_for_connection (
+ priv->account_manager, connection);
roomname = empathy_tp_chat_get_id (chat);
/* FIXME: This assume the account manager already exists */
manager = empathy_account_manager_dup_singleton ();
connection = tp_contact_get_connection (priv->tp_contact);
- priv->account = empathy_account_manager_get_account (manager, connection);
+ priv->account = empathy_account_manager_get_account_for_connection (
+ manager, connection);
g_object_ref (priv->account);
g_object_unref (manager);
}
EmpathyAccount *account;
TpConnection *connection;
- account = empathy_account_manager_lookup (priv->account_manager,
+ account = empathy_account_manager_get_account (priv->account_manager,
account_path);
/* FIXME */
g_assert (account != NULL);
}
tp_svc_client_handler_return_from_handle_channels (context);
-
- g_object_unref (account);
}
static void
unescaped = g_strdup_printf ("/%s", g_strdelimit (account_name, "%", '/'));
- hit->account = empathy_account_manager_lookup (priv->account_manager,
+ hit->account = empathy_account_manager_get_account (priv->account_manager,
unescaped);
+ if (hit->account != NULL)
+ g_object_ref (hit->account);
hit->filename = g_strdup (filename);
g_free (unescaped);
/* Lookup the new contact */
if (str) {
strv = g_strsplit (str, "/", 2);
- priv->account = empathy_account_manager_lookup (priv->account_manager,
+ priv->account = empathy_account_manager_get_account (priv->account_manager,
strv[0]);
priv->id = strv[1];
g_free (strv[0]);
}
if (priv->account) {
+ g_object_ref (priv->account);
connection = empathy_account_get_connection (priv->account);
if (connection) {
megaphone_applet_new_connection_cb (priv->account_manager,
strv = g_strsplit (id, "/", 2);
account_id = strv[0];
contact_id = strv[1];
- account = empathy_account_manager_lookup (account_manager, account_id);
+ account = empathy_account_manager_get_account (account_manager, account_id);
chat = empathy_chat_window_find_chat (account, contact_id);
if (!chat) {
connection, contact_id, NULL, NULL);
}
- g_object_unref (account);
g_strfreev (strv);
return;
}
- g_object_unref (account);
g_object_unref (account_manager);
g_strfreev (strv);
manager = empathy_account_manager_dup_singleton ();
connection = empathy_tp_chat_get_connection (tp_chat);
- account = empathy_account_manager_get_account (manager,
+ account = empathy_account_manager_get_account_for_connection (manager,
connection);
chat = empathy_chat_window_find_chat (account, id);
g_object_unref (manager);