Mercurial > pidgin
comparison pidgin/gtkmedia.c @ 23837:ddbea813862e
Notify the user which type of media session the remote user wants to initiate.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Thu, 12 Jun 2008 03:59:26 +0000 |
parents | 3bf9748fdef0 |
children | 9c6915254610 |
comparison
equal
deleted
inserted
replaced
23836:3bf9748fdef0 | 23837:ddbea813862e |
---|---|
425 pidgin_media_emit_message(gtkmedia, _("You have ended the call.")); | 425 pidgin_media_emit_message(gtkmedia, _("You have ended the call.")); |
426 gtk_widget_destroy(GTK_WIDGET(gtkmedia)); | 426 gtk_widget_destroy(GTK_WIDGET(gtkmedia)); |
427 } | 427 } |
428 | 428 |
429 static void | 429 static void |
430 pidgin_media_got_request_cb(PurpleMedia *media, PidginMedia *gtkmedia) | |
431 { | |
432 PurpleMediaStreamType type = purple_media_get_overall_type(media); | |
433 gchar *message; | |
434 | |
435 if (type & PURPLE_MEDIA_AUDIO && type & PURPLE_MEDIA_VIDEO) { | |
436 message = g_strdup_printf(_("%s wishes to start an audio/video session with you."), | |
437 purple_media_get_screenname(media)); | |
438 } else if (type & PURPLE_MEDIA_AUDIO) { | |
439 message = g_strdup_printf(_("%s wishes to start an audio session with you."), | |
440 purple_media_get_screenname(media)); | |
441 } else if (type & PURPLE_MEDIA_VIDEO) { | |
442 message = g_strdup_printf(_("%s wishes to start a video session with you."), | |
443 purple_media_get_screenname(media)); | |
444 } else { | |
445 return; | |
446 } | |
447 | |
448 pidgin_media_emit_message(gtkmedia, message); | |
449 g_free(message); | |
450 } | |
451 | |
452 static void | |
430 pidgin_media_got_hangup_cb(PurpleMedia *media, PidginMedia *gtkmedia) | 453 pidgin_media_got_hangup_cb(PurpleMedia *media, PidginMedia *gtkmedia) |
431 { | 454 { |
432 pidgin_media_emit_message(gtkmedia, _("The call has been terminated.")); | 455 pidgin_media_emit_message(gtkmedia, _("The call has been terminated.")); |
433 gtk_widget_destroy(GTK_WIDGET(gtkmedia)); | 456 gtk_widget_destroy(GTK_WIDGET(gtkmedia)); |
434 } | 457 } |
468 G_CALLBACK(pidgin_media_wait_cb), media); | 491 G_CALLBACK(pidgin_media_wait_cb), media); |
469 g_signal_connect(G_OBJECT(media->priv->media), "hangup", | 492 g_signal_connect(G_OBJECT(media->priv->media), "hangup", |
470 G_CALLBACK(pidgin_media_hangup_cb), media); | 493 G_CALLBACK(pidgin_media_hangup_cb), media); |
471 g_signal_connect(G_OBJECT(media->priv->media), "reject", | 494 g_signal_connect(G_OBJECT(media->priv->media), "reject", |
472 G_CALLBACK(pidgin_media_reject_cb), media); | 495 G_CALLBACK(pidgin_media_reject_cb), media); |
496 g_signal_connect(G_OBJECT(media->priv->media), "got-request", | |
497 G_CALLBACK(pidgin_media_got_request_cb), media); | |
473 g_signal_connect(G_OBJECT(media->priv->media), "got-hangup", | 498 g_signal_connect(G_OBJECT(media->priv->media), "got-hangup", |
474 G_CALLBACK(pidgin_media_got_hangup_cb), media); | 499 G_CALLBACK(pidgin_media_got_hangup_cb), media); |
475 g_signal_connect(G_OBJECT(media->priv->media), "got-accept", | 500 g_signal_connect(G_OBJECT(media->priv->media), "got-accept", |
476 G_CALLBACK(pidgin_media_accept_cb), media); | 501 G_CALLBACK(pidgin_media_accept_cb), media); |
477 break; | 502 break; |