/soc/2013/ankitkv/gobjectification: 21af2b190cfa: Various fixes ...

Ankit Vani a at nevitus.org
Sun Sep 22 13:22:32 EDT 2013


Changeset: 21af2b190cfaf741bc8bfe00a9bf44b04189a785
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-22 22:19 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/21af2b190cfa

Description:

Various fixes for protocol ids, functions and documentation

diffstat:

 libpurple/Makefile.mingw                       |   5 ++-
 libpurple/plugins/perl/common/Cmds.xs          |   2 +-
 libpurple/plugins/perl/common/Prpl.xs          |   2 +-
 libpurple/plugins/perl/scripts/account.pl      |   2 +-
 libpurple/plugins/perl/scripts/buddy_list.pl   |   2 +-
 libpurple/plugins/perl/scripts/conversation.pl |   2 +-
 libpurple/plugins/perl/scripts/plugin_pref.pl  |   2 +-
 libpurple/protocols/null/Makefile.am           |   2 +-
 libpurple/protocols/null/Makefile.mingw        |   2 +-
 libpurple/protocols/null/README                |  29 +++++++++++++------------
 libpurple/purple-remote                        |   6 +---
 libpurple/purple-send                          |   2 +-
 libpurple/purple-url-handler                   |  20 ++++++++--------
 libpurple/xfer.c                               |   4 +-
 14 files changed, 41 insertions(+), 41 deletions(-)

diffs (truncated from 319 to 300 lines):

diff --git a/libpurple/Makefile.mingw b/libpurple/Makefile.mingw
--- a/libpurple/Makefile.mingw
+++ b/libpurple/Makefile.mingw
@@ -105,13 +105,14 @@ C_SRC =	\
 			network.c \
 			notify.c \
 			ntlm.c \
-			plugin.c \
+			plugins.c \
 			pluginpref.c \
 			pounce.c \
 			prefs.c \
 			presence.c \
 			proxy.c \
-			prpl.c \
+			protocol.c \
+			protocols.c \
 			purple-socket.c \
 			request.c \
 			roomlist.c \
diff --git a/libpurple/plugins/perl/common/Cmds.xs b/libpurple/plugins/perl/common/Cmds.xs
--- a/libpurple/plugins/perl/common/Cmds.xs
+++ b/libpurple/plugins/perl/common/Cmds.xs
@@ -33,7 +33,7 @@ BOOT:
 		const_iv(VERY_LOW),
 		const_iv(LOW),
 		const_iv(DEFAULT),
-		const_iv(PRPL),
+		const_iv(PROTOCOL),
 		const_iv(PLUGIN),
 		const_iv(ALIAS),
 		const_iv(HIGH),
diff --git a/libpurple/plugins/perl/common/Prpl.xs b/libpurple/plugins/perl/common/Prpl.xs
--- a/libpurple/plugins/perl/common/Prpl.xs
+++ b/libpurple/plugins/perl/common/Prpl.xs
@@ -1,6 +1,6 @@
 #include "module.h"
 
-MODULE = Purple::Prpl  PACKAGE = Purple::Find  PREFIX = purple_find_
+MODULE = Purple::Prpl  PACKAGE = Purple::Find  PREFIX = purple_protocols_
 PROTOTYPES: ENABLE
 
 Purple::Plugin
diff --git a/libpurple/plugins/perl/scripts/account.pl b/libpurple/plugins/perl/scripts/account.pl
--- a/libpurple/plugins/perl/scripts/account.pl
+++ b/libpurple/plugins/perl/scripts/account.pl
@@ -27,7 +27,7 @@ use Purple;
 
 	# We will create these on load then destroy them on unload
 	my $TEST_NAME	 	= "perlTestName";
-	my $PROTOCOL_ID 	= "prpl-aim";
+	my $PROTOCOL_ID 	= "aim";
 
 
 sub plugin_init {
diff --git a/libpurple/plugins/perl/scripts/buddy_list.pl b/libpurple/plugins/perl/scripts/buddy_list.pl
--- a/libpurple/plugins/perl/scripts/buddy_list.pl
+++ b/libpurple/plugins/perl/scripts/buddy_list.pl
@@ -24,7 +24,7 @@ use Purple;
 	my $TEST_GROUP		= "UConn Buddies";
 	my $TEST_NAME	 	= "johnhkelm";
 	my $TEST_ALIAS	 	= "John Kelm";
-	my $PROTOCOL_ID 	= "prpl-aim";
+	my $PROTOCOL_ID 	= "aim";
 
 
 sub plugin_init {
diff --git a/libpurple/plugins/perl/scripts/conversation.pl b/libpurple/plugins/perl/scripts/conversation.pl
--- a/libpurple/plugins/perl/scripts/conversation.pl
+++ b/libpurple/plugins/perl/scripts/conversation.pl
@@ -30,7 +30,7 @@ use Purple;
 	my $TEST_GROUP		= "UConn Buddies";
 	my $TEST_NAME	 	= "johnhkelm";
 	my $TEST_ALIAS	 	= "John Kelm";
-	my $PROTOCOL_ID 	= "prpl-aim";
+	my $PROTOCOL_ID 	= "aim";
 
 
 sub plugin_init { 
diff --git a/libpurple/plugins/perl/scripts/plugin_pref.pl b/libpurple/plugins/perl/scripts/plugin_pref.pl
--- a/libpurple/plugins/perl/scripts/plugin_pref.pl
+++ b/libpurple/plugins/perl/scripts/plugin_pref.pl
@@ -28,7 +28,7 @@ use Purple;
 	my $TEST_GROUP		= "perlTestGroup";
 	my $TEST_NAME	 	= "perlTestName";
 	my $TEST_ALIAS	 	= "perlTestAlias";
-	my $PROTOCOL_ID 	= "prpl-aim";
+	my $PROTOCOL_ID 	= "aim";
 
 sub foo {
 	$frame = Purple::PluginPref::Frame->new();
diff --git a/libpurple/protocols/null/Makefile.am b/libpurple/protocols/null/Makefile.am
--- a/libpurple/protocols/null/Makefile.am
+++ b/libpurple/protocols/null/Makefile.am
@@ -12,7 +12,7 @@ AM_CFLAGS = $(st)
 
 libnull_la_LDFLAGS = -module -avoid-version
 
-# nullprpl isn't built by default. when it is built, it's dynamically linked.
+# nullprotocol isn't built by default; when it is built, it's dynamically linked
 st =
 pkg_LTLIBRARIES    = libnull.la
 libnull_la_SOURCES = $(NULLSOURCES)
diff --git a/libpurple/protocols/null/Makefile.mingw b/libpurple/protocols/null/Makefile.mingw
--- a/libpurple/protocols/null/Makefile.mingw
+++ b/libpurple/protocols/null/Makefile.mingw
@@ -37,7 +37,7 @@ LIB_PATHS +=		-L$(GTK_TOP)/lib \
 ##
 ##  SOURCES, OBJECTS
 ##
-C_SRC =	nullprpl.c
+C_SRC =	nullprotocol.c
 
 OBJECTS = $(C_SRC:%.c=%.o)
 
diff --git a/libpurple/protocols/null/README b/libpurple/protocols/null/README
--- a/libpurple/protocols/null/README
+++ b/libpurple/protocols/null/README
@@ -1,24 +1,24 @@
-nullprpl
+nullprotocol
 
 --------
 OVERVIEW
 --------
-Nullprpl is a mock protocol plugin for Pidgin and libpurple. You can create
+Nullprotocol is a mock protocol plugin for Pidgin and libpurple. You can create
 accounts with it, sign on and off, add buddies, and send and receive IMs, all
 without connecting to a server!
 
-Beyond that basic functionality, nullprpl supports presence and away/available
-messages, offline messages, user info, typing notification, privacy
-allow/block lists, chat rooms, whispering, room lists, and protocol icons and
-emblems. Notable missing features are file transfer and account registration
-and authentication.
+Beyond that basic functionality, nullprotocol supports presence and
+away/available messages, offline messages, user info, typing notification,
+privacy allow/block lists, chat rooms, whispering, room lists, and protocol
+icons and emblems. Notable missing features are file transfer and account
+registration and authentication.
 
-Nullprpl is intended as an example of how to write a libpurple protocol
+Nullprotocol is intended as an example of how to write a libpurple protocol
 plugin. It doesn't contain networking code or an event loop, but it does
-demonstrate how to use the libpurple API to do pretty much everything a prpl
+demonstrate how to use the libpurple API to do pretty much everything a protocol
 might need to do.
 
-Nullprpl is also a useful tool for hacking on Pidgin, Finch, and other
+Nullprotocol is also a useful tool for hacking on Pidgin, Finch, and other
 libpurple clients. It's a full-featured protocol plugin, but doesn't depend on
 an external server, so it's a quick and easy way to exercise test new code. It
 also allows you to work while you're disconnected.
@@ -31,14 +31,15 @@ To build, just run ./configure as usual 
 source distribution. Then cd libpurple/protocols/null and then make.  To
 install, run make install.  Then run Pidgin.
 
-To build nullprpl on Windows (with Cygwin/MinGW), use: make -f Makefile.mingw
+To build nullprotocol on Windows (with Cygwin/MinGW), use:
+make -f Makefile.mingw
 
 -----
 USAGE
 -----
-To add a nullprpl account, go to the account editor window and click Add.
-Select Nullprpl from the protocol drop-down list, and enter any username you
-want.
+To add a nullprotocol account, go to the account editor window and click Add.
+Select Null Protocol from the protocol drop-down list, and enter any username
+you want.
 
 Now, use Pidgin like normal. You can add buddies, send IMs, set away messages,
 etc. If you send IMs to your own username, they will be echoed back to you.
diff --git a/libpurple/purple-remote b/libpurple/purple-remote
--- a/libpurple/purple-remote
+++ b/libpurple/purple-remote
@@ -70,8 +70,8 @@ Examples of commands:
     getstatusmessage
     quit
 
-    PurpleAccountsFindConnected?name=&protocol=prpl-jabber
-    PurpleAccountsFindConnected(,prpl-jabber)
+    PurpleAccountsFindConnected?name=&protocol=jabber
+    PurpleAccountsFindConnected(,jabber)
 """ % sys.argv[0]
     if (requested):
         sys.exit(0)
@@ -112,8 +112,6 @@ def execute(uri):
     protocol = match.group(2)
     if protocol == "xmpp":
         protocol = "jabber"
-    if protocol is not None:
-        protocol = "prpl-" + protocol
     command = match.group(5)
     paramstring = match.group(7)
     params = {}
diff --git a/libpurple/purple-send b/libpurple/purple-send
--- a/libpurple/purple-send
+++ b/libpurple/purple-send
@@ -17,7 +17,7 @@ to specify the parameters.
 
 Examples:
 
-   $0 PurpleAccountsFindConnected string: string:prpl-jabber
+   $0 PurpleAccountsFindConnected string: string:jabber
    $0 PurpleAccountsGetAll
    $0 PurpleCoreQuit
 
diff --git a/libpurple/purple-url-handler b/libpurple/purple-url-handler
--- a/libpurple/purple-url-handler
+++ b/libpurple/purple-url-handler
@@ -119,7 +119,7 @@ def addbuddy(account, screenname, group=
 
 
 def aim(uri):
-    protocol = "prpl-aim"
+    protocol = "aim"
     match = re.match(r"^aim:([^?]*)(\?(.*))", uri)
     if not match:
         print "Invalid aim URI: %s" % uri
@@ -145,7 +145,7 @@ def aim(uri):
         addbuddy(account, screenname, params.get("group", ""))
 
 def gg(uri):
-    protocol = "prpl-gg"
+    protocol = "gg"
     match = re.match(r"^gg:(.*)", uri)
     if not match:
         print "Invalid gg URI: %s" % uri
@@ -156,7 +156,7 @@ def gg(uri):
     goim(account, screenname)
 
 def icq(uri):
-    protocol = "prpl-icq"
+    protocol = "icq"
     match = re.match(r"^icq:([^?]*)(\?(.*))", uri)
     if not match:
         print "Invalid icq URI: %s" % uri
@@ -182,7 +182,7 @@ def icq(uri):
         addbuddy(account, screenname, params.get("group", ""))
 
 def irc(uri):
-    protocol = "prpl-irc"
+    protocol = "irc"
     match = re.match(r"^irc:(//([^/]*))?/?([^?]*)(\?(.*))?", uri)
     if not match:
         print "Invalid irc URI: %s" % uri
@@ -222,7 +222,7 @@ def irc(uri):
             gochat(account, {"server": server, "channel": channel, "password": params.get("key", "")}, params.get("msg"))
 
 def msnim(uri):
-    protocol = "prpl-msn"
+    protocol = "msn"
     match = re.match(r"^msnim:([^?]*)(\?(.*))", uri)
     if not match:
         print "Invalid msnim URI: %s" % uri
@@ -245,12 +245,12 @@ def msnim(uri):
         addbuddy(account, screenname)
 
 def myim(uri):
-        protocol = "prpl-myspace"
+        protocol = "myspace"
         print "TODO: send uri: ", uri
         assert False, "Not implemented"
 
 def sip(uri):
-    protocol = "prpl-simple"
+    protocol = "simple"
     match = re.match(r"^sip:(.*)", uri)
     if not match:
         print "Invalid sip URI: %s" % uri
@@ -261,7 +261,7 @@ def sip(uri):
     goim(account, screenname)
 
 def xmpp(uri):
-    protocol = "prpl-jabber"
+    protocol = "jabber"
     match = re.match(r"^xmpp:(//([^/?#]*)/?)?([^?#]*)(\?([^;#]*)(;([^#]*))?)?(#(.*))?", uri)
     if not match:
         print "Invalid xmpp URI: %s" % uri
@@ -301,7 +301,7 @@ def xmpp(uri):
         goim(account, screenname)
 
 def gtalk(uri):
-    protocol = "prpl-jabber"
+    protocol = "jabber"
     match = re.match(r"^gtalk:([^?]*)(\?(.*))", uri)
     if not match:
         print "Invalid gtalk URI: %s" % uri
@@ -326,7 +326,7 @@ def gtalk(uri):
         goim(account, jid)
 
 def ymsgr(uri):
-    protocol = "prpl-yahoo"
+    protocol = "yahoo"
     match = re.match(r"^ymsgr:([^?]*)(\?([^&]*)(&(.*))?)", uri)
     if not match:
         print "Invalid ymsgr URI: %s" % uri
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c



More information about the Commits mailing list