~ubuntu-branches/ubuntu/precise/empathy/precise-proposed-201205180810

« back to all changes in this revision

Viewing changes to libempathy-gtk/empathy-new-call-dialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Brian Curtis, Brian Curtis, Ken VanDine
  • Date: 2011-06-01 10:35:24 UTC
  • mfrom: (1.1.70 upstream) (6.3.44 experimental)
  • Revision ID: james.westby@ubuntu.com-20110601103524-wx3wgp71394730jt
Tags: 3.1.1-1ubuntu1
[ Brian Curtis ]
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Drop geoclue/mapping build-depends (they are in Universe)
  - Add Vcz-Bzr link
  - Add Suggests on telepathy-idle
  - Bump telepathy-butterfly, telepathy-haze to recommends
  - Don't recommend the freedesktop sound theme we have an ubuntu one
  - Add build depend for libunity-dev
* debian/rules:
  - Use autoreconf.mk
  - Disable map and location
* debian/empathy.install:
  - Install message indicator configuration
* debian/indicators/empathy:
  - Message indicator configuration
* debian/patches/01_lpi.patch:
  - Add Launchpad integration
* debian/patches/10_use_notify_osd_icons.patch:
  - Use the notify-osd image for new messages
* debian/patches/34_start_raised_execpt_in_session.patch
  - If not started with the session, we should always raise
* debian/patches/36_chat_window_default_size.patch:
  - Make the default chat window size larger
* debian/patches/37_facebook_default.patch:
  - Make facebook the default chat account type
* debian/patches/38_lp_569289.patch
  - Set freenode as default IRC network for new IRC accounts 
* debian/patches/41_unity_launcher_progress.patch
  - Display file transfer progress in the unity launcher

[ Ken VanDine ]
* debian/control
  - build depend on libgcr-3-dev instead of libgcr-dev
  - dropped build depends for libindicate, we will use telepathy-indicator
  - Depend on dconf-gsettings-backend | gsettings-backend
  - Added a Recommends for telepathy-indicator
* +debian/empathy.gsettings-override
  - Added an override for notifications-focus
* debian/patches/series
  - commented out 23_idomessagedialog_for_voip_and_ft.patch, until ido has 
    been ported to gtk3

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include <telepathy-glib/interfaces.h>
30
30
 
31
 
#include <telepathy-yell/telepathy-yell.h>
32
 
 
33
31
#include <libempathy/empathy-tp-contact-factory.h>
34
32
#include <libempathy/empathy-contact-manager.h>
35
33
#include <libempathy/empathy-utils.h>
 
34
#include <libempathy/empathy-request-util.h>
36
35
 
37
36
#define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
38
37
#include <libempathy/empathy-debug.h>
42
41
 
43
42
#include "empathy-new-call-dialog.h"
44
43
#include "empathy-account-chooser.h"
45
 
#include "empathy-call-utils.h"
46
44
 
47
45
static EmpathyNewCallDialog *dialog_singleton = NULL;
48
46
 
64
62
  (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMPATHY_TYPE_NEW_CALL_DIALOG, \
65
63
    EmpathyNewCallDialogPriv))
66
64
 
 
65
static void
 
66
create_media_channel_cb (GObject *source,
 
67
    GAsyncResult *result,
 
68
    gpointer user_data)
 
69
{
 
70
  GError *error = NULL;
 
71
 
 
72
  if (!tp_account_channel_request_create_channel_finish (
 
73
        TP_ACCOUNT_CHANNEL_REQUEST (source), result, &error))
 
74
    {
 
75
      DEBUG ("Failed to create media channel: %s", error->message);
 
76
      g_error_free (error);
 
77
    }
 
78
}
 
79
 
67
80
/**
68
81
 * SECTION:empathy-new-call-dialog
69
82
 * @title: EmpathyNewCallDialog
75
88
 */
76
89
 
77
90
static void
 
91
call_contact (TpAccount *account,
 
92
    const gchar *contact_id,
 
93
    gboolean video,
 
94
    gint64 timestamp)
 
95
{
 
96
  GHashTable *request;
 
97
  TpAccountChannelRequest *req;
 
98
 
 
99
  request = tp_asv_new (
 
100
      TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
 
101
        TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
 
102
      TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
 
103
      TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, contact_id,
 
104
      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
 
105
        TRUE,
 
106
      TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
 
107
        video,
 
108
      NULL);
 
109
 
 
110
  req = tp_account_channel_request_new (account, request, timestamp);
 
111
 
 
112
  tp_account_channel_request_create_channel_async (req, EMPATHY_AV_BUS_NAME,
 
113
      NULL, create_media_channel_cb, NULL);
 
114
 
 
115
  g_object_unref (req);
 
116
}
 
117
 
 
118
static void
78
119
empathy_new_call_dialog_response (GtkDialog *dialog, int response_id)
79
120
{
80
121
  EmpathyNewCallDialogPriv *priv = GET_PRIV (dialog);
93
134
   * we return from this function. */
94
135
  video = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_video));
95
136
 
96
 
  empathy_call_new_with_streams (contact_id,
97
 
      account, TRUE, video, gtk_get_current_event_time ());
 
137
  call_contact (account, contact_id, video, gtk_get_current_event_time ());
98
138
 
99
139
out:
100
140
  gtk_widget_destroy (GTK_WIDGET (dialog));
128
168
 
129
169
      chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE);
130
170
 
131
 
      if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)
132
 
          && tp_strdiff (chan_type, TPY_IFACE_CHANNEL_TYPE_CALL))
 
171
      if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA))
133
172
        continue;
134
173
 
135
174
      if (tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) !=