]> git.0d.be Git - empathy.git/commitdiff
factor out empathy_call_window_stream_error
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 5 Nov 2009 12:38:28 +0000 (12:38 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 5 Nov 2009 13:34:58 +0000 (13:34 +0000)
src/empathy-call-window.c

index 64e72b130764f1c508705d5a7db7948b421b03a1..8bbc9c3915b23950ef979e7e88ec5a0c125723b2 100644 (file)
@@ -1526,10 +1526,11 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
 }
 
 static void
-empathy_call_window_audio_stream_error (EmpathyTpCall *call,
+empathy_call_window_stream_error (EmpathyCallWindow *self,
     guint code,
     const gchar *msg,
-    EmpathyCallWindow *self)
+    const gchar *icon,
+    const gchar *title)
 {
   gchar *desc;
 
@@ -1537,26 +1538,28 @@ empathy_call_window_audio_stream_error (EmpathyTpCall *call,
   if (desc == NULL)
     return;
 
-  display_error (self, "gnome-stock-mic", _("Can't establish audio stream"),
-      desc);
+  display_error (self, icon, title, desc);
   g_free (desc);
 }
 
 static void
-empathy_call_window_video_stream_error (EmpathyTpCall *call,
+empathy_call_window_audio_stream_error (EmpathyTpCall *call,
     guint code,
     const gchar *msg,
     EmpathyCallWindow *self)
 {
-  gchar *desc;
-
-  desc = media_stream_error_to_txt (self, code);
-  if (desc == NULL)
-    return;
+  empathy_call_window_stream_error (self, code, msg,
+      "gnome-stock-mic", _("Can't establish audio stream"));
+}
 
-  display_error (self, "camera-web", _("Can't establish video stream"),
-      desc);
-  g_free (desc);
+static void
+empathy_call_window_video_stream_error (EmpathyTpCall *call,
+    guint code,
+    const gchar *msg,
+    EmpathyCallWindow *self)
+{
+  empathy_call_window_stream_error (self, code, msg,
+      "camera-web", _("Can't establish video stream"));
 }
 
 static gboolean