/pidgin/main: 2953de8b793c: The Mxit VoIP support never left bet...

Andrew Victor <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 2953de8b793c358da36be99d2438695bbf885cd4
Author:	 Andrew Victor <[email protected]>
Date:	 2016-05-07 16:28 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/2953de8b793c

Description:

The Mxit VoIP support never left beta (and has since been discontinued), so remove the partial prototype implementation from libpurple.

diffstat:

 libpurple/protocols/mxit/Makefile.am    |    4 +-
 libpurple/protocols/mxit/Makefile.mingw |    3 +-
 libpurple/protocols/mxit/mxit.c         |    5 +-
 libpurple/protocols/mxit/mxit.h         |    3 -
 libpurple/protocols/mxit/protocol.c     |   17 --
 libpurple/protocols/mxit/voicevideo.c   |  243 --------------------------------
 libpurple/protocols/mxit/voicevideo.h   |   36 ----
 7 files changed, 4 insertions(+), 307 deletions(-)

diffs (truncated from 399 to 300 lines):

diff --git a/libpurple/protocols/mxit/Makefile.am b/libpurple/protocols/mxit/Makefile.am
--- a/libpurple/protocols/mxit/Makefile.am
+++ b/libpurple/protocols/mxit/Makefile.am
@@ -33,9 +33,7 @@ MXITSOURCES = \
 	roster.c \
 	roster.h \
 	splashscreen.c \
-	splashscreen.h \
-	voicevideo.c \
-	voicevideo.h
+	splashscreen.h
 
 
 AM_CFLAGS = $(st)
diff --git a/libpurple/protocols/mxit/Makefile.mingw b/libpurple/protocols/mxit/Makefile.mingw
--- a/libpurple/protocols/mxit/Makefile.mingw
+++ b/libpurple/protocols/mxit/Makefile.mingw
@@ -51,8 +51,7 @@ C_SRC =			actions.c \
 			profile.c \
 			protocol.c \
 			roster.c \
-			splashscreen.c \
-			voicevideo.c
+			splashscreen.c
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -36,7 +36,6 @@
 #include	"filexfer.h"
 #include	"actions.h"
 #include	"multimx.h"
-#include	"voicevideo.h"
 
 
 #ifdef	MXIT_LINK_CLICK
@@ -789,8 +788,8 @@ static PurplePluginProtocolInfo proto_in
 	NULL,					/* attention_types */
 	sizeof( PurplePluginProtocolInfo ),		/* struct_size */
 	mxit_get_text_table,	/* get_account_text_table */
-	mxit_media_initiate,	/* initiate_media */
-	mxit_media_caps,		/* get_media_caps */
+	NULL,					/* initiate_media */
+	NULL,					/* get_media_caps */
 	mxit_get_moods,			/* get_moods */
 	NULL,					/* set_public_alias */
 	NULL,					/* get_public_alias */
diff --git a/libpurple/protocols/mxit/mxit.h b/libpurple/protocols/mxit/mxit.h
--- a/libpurple/protocols/mxit/mxit.h
+++ b/libpurple/protocols/mxit/mxit.h
@@ -142,9 +142,6 @@ struct MXitSession {
 	gint64				http_last_poll;				/* the last time a poll has been sent */
 	guint				http_handler;				/* HTTP connection handler */
 
-	/* other servers */
-	char				voip_server[HOST_NAME_MAX];	/* voice/video server */
-
 	/* client */
 	struct login_data*	logindata;
 	char*				encpwd;						/* encrypted password */
diff --git a/libpurple/protocols/mxit/protocol.c b/libpurple/protocols/mxit/protocol.c
--- a/libpurple/protocols/mxit/protocol.c
+++ b/libpurple/protocols/mxit/protocol.c
@@ -39,7 +39,6 @@
 #include	"formcmds.h"
 #include	"http.h"
 #include	"cipher.h"
-#include	"voicevideo.h"
 
 
 #define		MXIT_MS_OFFSET		3
@@ -707,12 +706,6 @@ void mxit_send_register( struct MXitSess
 
 	locale = purple_account_get_string( session->acc, MXIT_CONFIG_LOCALE, MXIT_DEFAULT_LOCALE );
 
-	/* Voice and Video supported */
-	if ( mxit_audio_enabled() && mxit_video_enabled() )
-		features |= ( MXIT_CF_VOICE | MXIT_CF_VIDEO );
-	else if ( mxit_audio_enabled() )
-		features |= MXIT_CF_VOICE;
-
 	/* generate client version string (eg, P-2.7.10-Y-PURPLE) */
 	clientVersion = g_strdup_printf( "%c-%i.%i.%i-%s-%s", MXIT_CP_DISTCODE, PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION, PURPLE_MICRO_VERSION, MXIT_CP_ARCH, MXIT_CP_PLATFORM );
 
@@ -751,12 +744,6 @@ void mxit_send_login( struct MXitSession
 
 	locale = purple_account_get_string( session->acc, MXIT_CONFIG_LOCALE, MXIT_DEFAULT_LOCALE );
 
-	/* Voice and Video supported */
-	if ( mxit_audio_enabled() && mxit_video_enabled() )
-		features |= ( MXIT_CF_VOICE | MXIT_CF_VIDEO );
-	else if ( mxit_audio_enabled() )
-		features |= MXIT_CF_VOICE;
-
 	/* generate client version string (eg, P-2.7.10-Y-PURPLE) */
 	clientVersion = g_strdup_printf( "%c-%i.%i.%i-%s-%s", MXIT_CP_DISTCODE, PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION, PURPLE_MICRO_VERSION, MXIT_CP_ARCH, MXIT_CP_PLATFORM );
 
@@ -1488,10 +1475,6 @@ static void mxit_parse_cmd_login( struct
 	if ( records[1]->fcount >= 9 )
 		session->uid = g_strdup( records[1]->fields[8]->data );
 
-	/* extract VoIP server (from protocol 6.2) */
-	if ( records[1]->fcount >= 11 )
-		g_strlcpy( session->voip_server, records[1]->fields[10]->data, sizeof( session->voip_server ) );
-
 	/* display the current splash-screen */
 	if ( splash_popup_enabled( session ) )
 		splash_display( session );
diff --git a/libpurple/protocols/mxit/voicevideo.c b/libpurple/protocols/mxit/voicevideo.c
deleted file mode 100644
--- a/libpurple/protocols/mxit/voicevideo.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- *					MXit Protocol libPurple Plugin
- *
- *						-- voice & video --
- *
- *				Andrew Victor	<[email protected]>
- *
- *			(C) Copyright 2010	MXit Lifestyle (Pty) Ltd.
- *				<http://www.mxitlifestyle.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- */
-
-#include "internal.h"
-
-#include "mxit.h"
-#include "roster.h"
-#include "voicevideo.h"
-
-#if defined(USE_VV) && defined(MXIT_DEV_VV)
-
-#warning "MXit VV support enabled."
-
-/*------------------------------------------------------------------------
- * Does this client support Voice?
- */
-gboolean mxit_audio_enabled(void)
-{
-    PurpleMediaManager *manager = purple_media_manager_get();
-    PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager);
-
-    return (caps & PURPLE_MEDIA_CAPS_AUDIO);
-}
-
-/*------------------------------------------------------------------------
- * Does this client support Voice and Video?
- */
-gboolean mxit_video_enabled(void)
-{
-    PurpleMediaManager *manager = purple_media_manager_get();
-    PurpleMediaCaps caps = purple_media_manager_get_ui_caps(manager);
-
-    return (caps & PURPLE_MEDIA_CAPS_VIDEO);
-}
-
-/*------------------------------------------------------------------------
- * Return the list of media capabilities this contact supports.
- *
- *  @param account		The MXit account object
- *  @param who			The username of the contact.
- *  @return				The media capabilities supported
- */
-PurpleMediaCaps mxit_media_caps(PurpleAccount *account, const char *who)
-{
-	struct MXitSession*	session	= purple_connection_get_protocol_data(purple_account_get_connection(account));
-	PurpleBuddy*		buddy;
-	struct contact*		contact;
-	PurpleMediaCaps		capa	= PURPLE_MEDIA_CAPS_NONE;
-
-	purple_debug_info(MXIT_PLUGIN_ID, "mxit_media_caps: buddy '%s'\n", who);
-
-	/* We need to have a voice/video server */
-	if (strlen(session->voip_server) == 0)
-		return PURPLE_MEDIA_CAPS_NONE;
-
-	/* find the buddy information for this contact (reference: "libpurple/blist.h") */
-	buddy = purple_find_buddy(account, who);
-	if (!buddy) {
-		purple_debug_warning(MXIT_PLUGIN_ID, "mxit_media_caps: unable to find the buddy '%s'\n", who);
-		return PURPLE_MEDIA_CAPS_NONE;
-	}
-
-	contact = purple_buddy_get_protocol_data(buddy);
-	if (!contact)
-		return PURPLE_MEDIA_CAPS_NONE;
-
-	/* can only communicate with MXit users */
-	if (contact->type != MXIT_TYPE_MXIT)
-		return PURPLE_MEDIA_CAPS_NONE;
-
-	/* and only with contacts in the 'Both' subscription state */
-	if (contact->subtype != MXIT_SUBTYPE_BOTH)
-		return PURPLE_MEDIA_CAPS_NONE;
-
-	/* and only when they're online */
-	if (contact->presence == MXIT_PRESENCE_OFFLINE)
-		return PURPLE_MEDIA_CAPS_NONE;
-
-	/* they support voice-only */
-	if (contact->capabilities & MXIT_PFLAG_VOICE)
-		capa |= PURPLE_MEDIA_CAPS_AUDIO;
-
-	/* they support voice-and-video */
-	if (contact->capabilities & MXIT_PFLAG_VIDEO)
-		capa |= (PURPLE_MEDIA_CAPS_AUDIO | PURPLE_MEDIA_CAPS_VIDEO | PURPLE_MEDIA_CAPS_AUDIO_VIDEO);
-
-	return capa;
-}
-
-
-static void mxit_candidates_prepared_cb(PurpleMedia* media, gchar* sessionid, gchar* who, void* session)
-{
-	purple_debug_info(MXIT_PLUGIN_ID, "mxit_candidates_prepared_cb: buddy '%s', session '%s'\n", who, sessionid);
-
-	if (purple_media_is_initiator(media, sessionid, who)) {
-		// TODO: Send INVITE via SIP.
-	}
-	else {
-		// TODO: ??
-	}
-}
-
-static void mxit_stream_info_cb(PurpleMedia* media, PurpleMediaInfoType type, char* sessionid, gchar* who, gboolean local, void* session)
-{
-	purple_debug_info(MXIT_PLUGIN_ID, "mxit_stream_info_cb: buddy '%s', session '%s', info %d \n", who, sessionid, type);
-
-	switch (type) {
-		case PURPLE_MEDIA_INFO_HANGUP:
-			break;
-		case PURPLE_MEDIA_INFO_ACCEPT:
-			break;
-		case PURPLE_MEDIA_INFO_REJECT:
-			break;
-		case PURPLE_MEDIA_INFO_MUTE:
-			break;
-		case PURPLE_MEDIA_INFO_UNMUTE:
-			break;
-		case PURPLE_MEDIA_INFO_PAUSE:
-			break;
-		case PURPLE_MEDIA_INFO_UNPAUSE:
-			break;
-		case PURPLE_MEDIA_INFO_HOLD:
-			break;
-		case PURPLE_MEDIA_INFO_UNHOLD:
-			break;
-	}
-}
-
-static void mxit_state_changed_cb(PurpleMedia* media, PurpleMediaState state, gchar* sessionid, char* who, void* session)
-{
-	purple_debug_info(MXIT_PLUGIN_ID, "mxit_state_changed_cb: buddy '%s', session '%s', state %d\n", who, sessionid, state);
-
-	switch (state) {
-		case PURPLE_MEDIA_STATE_NEW:
-			break;
-		case PURPLE_MEDIA_STATE_CONNECTED:
-			break;
-		case PURPLE_MEDIA_STATE_END:
-			break;
-	}
-}
-
-
-/*------------------------------------------------------------------------
- * Initiate a voice/video session with a contact.
- *
- *  @param account		The MXit account object
- *  @param who			The username of the contact.
- *  @param type			The type of media session to initiate
- *  @return				TRUE if session was initiated
- */
-gboolean mxit_media_initiate(PurpleAccount *account, const char *who, PurpleMediaSessionType type)
-{
-	gchar* transmitter = "rawudp";
-	PurpleMedia* media = NULL;
-
-	purple_debug_info(MXIT_PLUGIN_ID, "mxit_media_initiate: buddy '%s'\n", who);
-
-	media = purple_media_manager_create_media(
-		purple_media_manager_get(),
-		account,
-		"fsrtpconference",
-		who,

_______________________________________________
Commits mailing list
[email protected]
https://pidgin.im/cgi-bin/mailman/listinfo/commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.