pidgin.vv: c12bd89a: Added reject and hangup states to the st...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Jan 13 01:55:50 EST 2009


-----------------------------------------------------------------
Revision: c12bd89a902ddd3a7fc9a9c274501f0b44a94593
Ancestor: 25ba9e3fda04e25b588d67d05f56387423df7166
Author: maiku at soc.pidgin.im
Date: 2009-01-13T05:32:34
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/c12bd89a902ddd3a7fc9a9c274501f0b44a94593

Modified files:
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Added reject and hangup states to the state-changed signal.

-------------- next part --------------
============================================================
--- libpurple/media.c	f326bacb7c29aaf6da5bf346d001f84186470633
+++ libpurple/media.c	a4fba0042db41ed308ecd5e9687fb63ac2ec8591
@@ -1313,6 +1313,9 @@ purple_media_hangup(PurpleMedia *media)
 purple_media_hangup(PurpleMedia *media)
 {
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
+			0, PURPLE_MEDIA_STATE_CHANGED_HANGUP,
+			NULL, NULL);
+	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_END,
 			NULL, NULL);
 	g_signal_emit(media, purple_media_signals[HANGUP], 0);
@@ -1322,6 +1325,9 @@ purple_media_reject(PurpleMedia *media)
 purple_media_reject(PurpleMedia *media)
 {
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
+			0, PURPLE_MEDIA_STATE_CHANGED_REJECTED,
+			NULL, NULL);
+	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_END,
 			NULL, NULL);
 	g_signal_emit(media, purple_media_signals[REJECT], 0);
@@ -1336,15 +1342,9 @@ purple_media_got_hangup(PurpleMedia *med
 void
 purple_media_got_hangup(PurpleMedia *media)
 {
-/*
- * There's no way to tell who hung up with the new structure.
- * I'm commenting this out until this is resolved.
- */
-#if 0
 	g_signal_emit(media, purple_media_signals[STATE_CHANGED],
 			0, PURPLE_MEDIA_STATE_CHANGED_END,
 			NULL, NULL);
-#endif
 	g_signal_emit(media, purple_media_signals[GOT_HANGUP], 0);
 }
 
============================================================
--- libpurple/media.h	aa7c6c28b454c34757647d23519241ccfff7fae8
+++ libpurple/media.h	f36f4228fd2ed8c5a8b151a7876c5c89d488a347
@@ -80,6 +80,8 @@ typedef enum {
 typedef enum {
 	PURPLE_MEDIA_STATE_CHANGED_NEW = 0,
 	PURPLE_MEDIA_STATE_CHANGED_CONNECTED,
+	PURPLE_MEDIA_STATE_CHANGED_REJECTED,	/** Local user rejected the stream. */
+	PURPLE_MEDIA_STATE_CHANGED_HANGUP,	/** Local user hung up the stream */
 	PURPLE_MEDIA_STATE_CHANGED_END,
 } PurpleMediaStateChangedType;
 
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	0d21b40206d56f9ab14770ef6c894020a7c6a9cc
+++ libpurple/protocols/jabber/jingle/rtp.c	3ff18322442d9a4161e9e859e88efffd3b2f6736
@@ -320,7 +320,8 @@ jingle_rtp_state_changed_cb(PurpleMedia 
 {
 	purple_debug_info("jingle-rtp", "state-changed: type %d id: %s name: %s\n", type, sid, name);
 
-	if (type == PURPLE_MEDIA_STATE_CHANGED_END &&
+	if ((type == PURPLE_MEDIA_STATE_CHANGED_REJECTED ||
+			type == PURPLE_MEDIA_STATE_CHANGED_HANGUP) &&
 			sid == NULL && name == NULL) {
 		gchar *sid = jingle_session_get_sid(session);
 		jabber_iq_send(jingle_session_to_packet(session,


More information about the Commits mailing list