#include <telepathy-glib/telepathy-glib.h>
+#include <libempathy/empathy-client-factory.h>
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-message.h>
#include <libempathy/empathy-chatroom-manager.h>
tp_chat = empathy_chat_get_tp_chat (priv->current_chat);
if (tp_chat != NULL) {
- connection = empathy_tp_chat_get_connection (tp_chat);
+ connection = tp_channel_borrow_connection (TP_CHANNEL (tp_chat));
sensitive = empathy_tp_chat_can_add_contact (tp_chat) &&
(tp_connection_get_status (connection, NULL) ==
EmpathyChatWindowPriv *priv;
GtkWidget *dialog;
EmpathyTpChat *tp_chat;
- TpChannel *channel;
int response;
- TpAccount *account;
priv = GET_PRIV (window);
g_return_if_fail (priv->current_chat != NULL);
tp_chat = empathy_chat_get_tp_chat (priv->current_chat);
- channel = empathy_tp_chat_get_channel (tp_chat);
- account = empathy_chat_get_account (priv->current_chat);
dialog = empathy_invite_participant_dialog_new (
GTK_WINDOW (priv->dialog), tp_chat);
notify_notification_set_hint_string (notification,
EMPATHY_NOTIFY_MANAGER_CAP_X_CANONICAL_APPEND, "1");
}
+
+ notify_notification_set_hint (notification,
+ EMPATHY_NOTIFY_MANAGER_CAP_CATEGORY,
+ g_variant_new_string ("im.received"));
}
pixbuf = empathy_notify_manager_get_pixbuf_for_notification (priv->notify_mgr,
* a) the chatroom's always_urgent property is TRUE
* b) the message contains our alias
*/
- if (empathy_chat_is_room (chat) ||
- empathy_chat_get_remote_contact (chat) == NULL) {
+ if (empathy_chat_is_room (chat)) {
TpAccount *account;
const gchar *room;
EmpathyChatroom *chatroom;
EmpathyChat *chat = NULL;
EmpathyChatWindow *old_window;
TpAccount *account = NULL;
- TpAccountManager *account_manager;
+ EmpathyClientFactory *factory;
const gchar *id;
gchar **strv;
const gchar *account_id;
id = (const gchar*) gtk_selection_data_get_data (selection);
- /* FIXME: Perhaps should be sure that the account manager is
- * prepared before calling _ensure_account on it. */
- account_manager = tp_account_manager_dup ();
+ factory = empathy_client_factory_dup ();
DEBUG ("DND contact from roster with id:'%s'", id);
account_id = strv[0];
contact_id = strv[1];
account =
- tp_account_manager_ensure_account (account_manager, account_id);
+ tp_simple_client_factory_ensure_account (
+ TP_SIMPLE_CLIENT_FACTORY (factory), account_id,
+ NULL, NULL);
+
+ g_object_unref (factory);
if (account != NULL)
chat = empathy_chat_window_find_chat (account, contact_id, FALSE);
}
if (!chat) {
empathy_chat_with_contact_id (
- account, contact_id, empathy_get_current_action_time ());
+ account, contact_id,
+ empathy_get_current_action_time (),
+ NULL, NULL);
g_strfreev (strv);
return;
}
- g_object_unref (account_manager);
g_strfreev (strv);
old_window = chat_window_find_chat (chat);
window);
}
-static GtkWidget *
-empathy_chat_window_get_dialog (EmpathyChatWindow *window)
-{
- EmpathyChatWindowPriv *priv;
-
- g_return_val_if_fail (window != NULL, NULL);
-
- priv = GET_PRIV (window);
-
- return priv->dialog;
-}
-
/* Returns the window to open a new tab in if there is a suitable window,
* otherwise, returns NULL indicating that a new window should be added.
*/
for (l = chat_windows; l; l = l->next) {
EmpathyChatWindow *chat_window;
- GtkWidget *dialog;
guint nb_rooms, nb_private;
chat_window = l->data;
- dialog = empathy_chat_window_get_dialog (chat_window);
-
empathy_chat_window_get_nb_chats (chat_window, &nb_rooms, &nb_private);
/* Skip the window if there aren't any rooms in it */
if (!room && nb_private == 0)
continue;
- /* Found a window on this desktop, make it visible if necessary */
- if (!empathy_window_get_is_visible (GTK_WINDOW (dialog)))
- empathy_window_present (GTK_WINDOW (dialog));
return chat_window;
}