static void
new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
{
	EmpathyAccountChooser *account_chooser;
	TpAccount *account;
	const gchar           *room;
	const gchar           *server = NULL;
	gchar                 *room_name = NULL;

	room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
	server = gtk_entry_get_text (GTK_ENTRY (dialog->entry_server));

	account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
	account = empathy_account_chooser_get_account (account_chooser);

	if (!EMP_STR_EMPTY (server)) {
		room_name = g_strconcat (room, "@", server, NULL);
	} else {
		room_name = g_strdup (room);
	}

	g_strstrip (room_name);

	DEBUG ("Requesting channel for '%s'", room_name);

	empathy_join_muc (account, room_name, empathy_get_current_action_time ());

	g_free (room_name);
}
static void
empathy_contact_video_call_menu_item_activated (GtkMenuItem *item,
	EmpathyContact *contact)
{
	empathy_call_new_with_streams (empathy_contact_get_id (contact),
		empathy_contact_get_account (contact),
		TRUE, TRUE,
		empathy_get_current_action_time ());
}
static gboolean
channel_name_activated_cb (
    GtkLabel *label,
    gchar *uri,
    TpAccount *account)
{
  empathy_join_muc (account, uri, empathy_get_current_action_time ());
  return TRUE;
}
Example #4
0
void
empathy_chat_manager_call_undo_closed_chat (void)
{
  gint64 action_time;

  action_time = empathy_get_current_action_time ();

  empathy_gen_chat_manager_proxy_new_for_bus (G_BUS_TYPE_SESSION,
      G_DBUS_PROXY_FLAGS_NONE, EMPATHY_CHAT_BUS_NAME, CHAT_MANAGER_PATH,
      NULL, chat_mgr_proxy_cb,
      /* We can't use GINT_TO_POINTER as we won't be able to store a 64 bits
       * integer on a 32 bits plateform. Use a GVariant for its convenient
       * API. */
      g_variant_new_int64 (action_time));
}
Example #5
0
void
empathy_send_file (EmpathyContact *contact,
    GFile *file)
{
  EmpathyFTFactory *factory;
  GtkRecentManager *manager;
  gchar *uri;

  g_return_if_fail (EMPATHY_IS_CONTACT (contact));
  g_return_if_fail (G_IS_FILE (file));

  factory = empathy_ft_factory_dup_singleton ();

  empathy_ft_factory_new_transfer_outgoing (factory, contact, file,
      empathy_get_current_action_time ());

  uri = g_file_get_uri (file);
  manager = gtk_recent_manager_get_default ();
  gtk_recent_manager_add_item (manager, uri);
  g_free (uri);

  g_object_unref (factory);
}
Example #6
0
void
empathy_chat_manager_call_undo_closed_chat (void)
{
  TpDBusDaemon *dbus_daemon = tp_dbus_daemon_dup (NULL);
  TpProxy *proxy;

  if (dbus_daemon == NULL)
    return;

  proxy = g_object_new (TP_TYPE_PROXY,
      "dbus-daemon", dbus_daemon,
      "dbus-connection", tp_proxy_get_dbus_connection (TP_PROXY (dbus_daemon)),
      "bus-name", EMPATHY_CHAT_BUS_NAME,
      "object-path", "/org/gnome/Empathy/ChatManager",
      NULL);

  tp_proxy_add_interface_by_id (proxy, EMP_IFACE_QUARK_CHAT_MANAGER);

  emp_cli_chat_manager_call_undo_closed_chat (proxy, -1, empathy_get_current_action_time (),
      NULL, NULL, NULL, NULL);

  g_object_unref (proxy);
  g_object_unref (dbus_daemon);
}
static void
empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
	EmpathyContact *contact)
{
	empathy_chat_with_contact (contact, empathy_get_current_action_time ());
}