summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Laager <rlaager@pidgin.im>2007-04-15 18:09:14 +0000
committerRichard Laager <rlaager@pidgin.im>2007-04-15 18:09:14 +0000
commitc639621e22d291bfec009b71b897f65086c7f89d (patch)
treebe1062453886932da9bc3371931183e7e1aeee65
parent7c3a0c99d4c9aa07b6fb3ad8069d51d002f8b619 (diff)
downloadpidgin-c639621e22d291bfec009b71b897f65086c7f89d.tar.gz
Trac Ticket #149 from JensenDied
This patch does a rename of our DBus stuff.
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac2
-rwxr-xr-xfinch/libgnt/pygnt/dbus-gnt12
-rw-r--r--gaim.service.in4
-rw-r--r--libpurple/dbus-purple.h6
-rw-r--r--libpurple/dbus-server.c4
-rw-r--r--libpurple/plugins/dbus-buddyicons-example.py16
-rw-r--r--libpurple/purple-notifications-example38
-rwxr-xr-xlibpurple/purple-remote72
-rwxr-xr-xlibpurple/purple-send12
-rwxr-xr-xlibpurple/purple-send-async6
-rwxr-xr-xlibpurple/purple-url-handler61
-rw-r--r--pidgin.spec.in2
13 files changed, 131 insertions, 108 deletions
diff --git a/Makefile.am b/Makefile.am
index c5e6efabc9..b8a75fbfc5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,7 @@ EXTRA_DIST = \
config.h.mingw \
gaim.pc.in \
gaim-uninstalled.pc.in \
- gaim.service.in \
+ purple.service.in \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
@@ -26,7 +26,7 @@ noinst_HEADERS = config.h
if ENABLE_DBUS
dbus_servicedir=$(DBUS_SERVICES_DIR)
-dbus_service_DATA=gaim.service
+dbus_service_DATA=purple.service
endif
dist-hook: pidgin.spec
diff --git a/configure.ac b/configure.ac
index 374d83af83..ee6cf4fc61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1893,7 +1893,7 @@ fi
AC_OUTPUT([Makefile
Doxyfile
- gaim.service
+ purple.service
doc/Makefile
doc/pidgin.1
doc/finch.1
diff --git a/finch/libgnt/pygnt/dbus-gnt b/finch/libgnt/pygnt/dbus-gnt
index 34047ed15e..e488804af8 100755
--- a/finch/libgnt/pygnt/dbus-gnt
+++ b/finch/libgnt/pygnt/dbus-gnt
@@ -37,23 +37,23 @@ def wrote_msg(account, who, msg, conv, flags):
gnt.gnt_init()
bus = dbus.SessionBus()
-obj = bus.get_object("net.sf.purple.PurpleService", "/net/sf/purple/PurpleObject")
-purple = dbus.Interface(obj, "net.sf.purple.PurpleInterface")
+obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
bus.add_signal_receiver(buddysignedon,
- dbus_interface = "net.sf.purple.PurpleInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "BuddySignedOn")
bus.add_signal_receiver(wrote_msg,
- dbus_interface = "net.sf.purple.PurpleInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "WroteImMsg")
bus.add_signal_receiver(wrote_msg,
- dbus_interface = "net.sf.purple.PurpleInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "WroteChatMsg")
bus.add_signal_receiver(conv_closed,
- dbus_interface = "net.sf.purple.PurpleInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "DeletingConversation")
def get_dict_key(conv):
diff --git a/gaim.service.in b/gaim.service.in
index 92c509a620..fa57c0ba07 100644
--- a/gaim.service.in
+++ b/gaim.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
-Name=org.gaim.GaimService
-Exec=@bindir@/gaim
+Name=im.pidgin.purple.PurpleService
+Exec=/bin/false
diff --git a/libpurple/dbus-purple.h b/libpurple/dbus-purple.h
index 4d519beb15..278db18992 100644
--- a/libpurple/dbus-purple.h
+++ b/libpurple/dbus-purple.h
@@ -24,8 +24,8 @@
#ifndef _DBUS_PURPLE_H_
#define _DBUS_PURPLE_H_
-#define DBUS_SERVICE_PURPLE "net.sf.purple.PurpleService"
-#define DBUS_PATH_PURPLE "/net/sf/purple/PurpleObject"
-#define DBUS_INTERFACE_PURPLE "net.sf.purple.PurpleInterface"
+#define DBUS_SERVICE_PURPLE "im.pidgin.purple.PurpleService"
+#define DBUS_PATH_PURPLE "/im/pidgin/purple/PurpleObject"
+#define DBUS_INTERFACE_PURPLE "im.pidgin.purple.PurpleInterface"
#endif /* _DBUS_PURPLE_H_ */
diff --git a/libpurple/dbus-server.c b/libpurple/dbus-server.c
index 0e034e3fd5..381bd16148 100644
--- a/libpurple/dbus-server.c
+++ b/libpurple/dbus-server.c
@@ -143,7 +143,7 @@ purple_dbus_pointer_to_id_error(gpointer ptr, DBusError *error)
gint id = purple_dbus_pointer_to_id(ptr);
if (ptr != NULL && id == 0)
- dbus_set_error(error, "net.sf.purple.ObjectNotFound",
+ dbus_set_error(error, "im.pidgin.purple.ObjectNotFound",
"The return object is not mapped (this is a Purple error)");
return id;
@@ -156,7 +156,7 @@ purple_dbus_id_to_pointer_error(gint id, PurpleDBusType *type,
gpointer ptr = purple_dbus_id_to_pointer(id, type);
if (ptr == NULL && id != 0)
- dbus_set_error(error, "net.sf.purple.InvalidHandle",
+ dbus_set_error(error, "im.pidgin.purple.InvalidHandle",
"%s object with ID = %i not found", typename, id);
return ptr;
diff --git a/libpurple/plugins/dbus-buddyicons-example.py b/libpurple/plugins/dbus-buddyicons-example.py
index d501370568..5fabbaea1a 100644
--- a/libpurple/plugins/dbus-buddyicons-example.py
+++ b/libpurple/plugins/dbus-buddyicons-example.py
@@ -2,7 +2,7 @@
#
# Print the aliases of buddies who have a buddy-icon set.
#
-# Gaim is the legal property of its developers, whose names are too numerous
+# Purple is the legal property of its developers, whose names are too numerous
# to list here. Please refer to the COPYRIGHT file distributed with this
# source distribution.
#
@@ -24,13 +24,13 @@
import dbus
bus = dbus.SessionBus()
-obj = bus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
-gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
+obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
-node = gaim.GaimBlistGetRoot()
+node = purple.PurpleBlistGetRoot()
while node != 0:
- if gaim.GaimBlistNodeIsBuddy(node):
- icon = gaim.GaimBuddyGetIcon(node)
+ if purple.PurpleBlistNodeIsBuddy(node):
+ icon = purple.PurpleBuddyGetIcon(node)
if icon != 0:
- print gaim.GaimBuddyGetAlias(node)
- node = gaim.GaimBlistNodeNext(node, 0)
+ print purple.PurpleBuddyGetAlias(node)
+ node = purple.PurpleBlistNodeNext(node, 0)
diff --git a/libpurple/purple-notifications-example b/libpurple/purple-notifications-example
index 7fbe03e15f..7dee6a601e 100644
--- a/libpurple/purple-notifications-example
+++ b/libpurple/purple-notifications-example
@@ -1,12 +1,12 @@
#!/usr/bin/env python
-# This is a simple gaim notification server.
+# This is a simple purple notification server.
# It shows notifications when your buddy signs on or you get an IM message.
#
# This script requires Python 2.4 and PyGTK bindings
#
# Note that all function names are resolved dynamically, no
-# gaim-specific library is needed.
+# purple-specific library is needed.
import dbus
import dbus.glib
@@ -19,12 +19,12 @@ def ensureimconversation(conversation, account, name):
return conversation
else:
# 1 = GAIM_CONV_IM
- return gaim.GaimConversationNew(1, account, name)
+ return purple.PurpleConversationNew(1, account, name)
def receivedimmsg(account, name, message, conversation, flags):
- buddy = gaim.GaimFindBuddy(account, name)
+ buddy = purple.PurpleFindBuddy(account, name)
if buddy != 0:
- alias = gaim.GaimBuddyGetAlias(buddy)
+ alias = purple.PurpleBuddyGetAlias(buddy)
else:
alias = name
@@ -38,19 +38,19 @@ def receivedimmsg(account, name, message, conversation, flags):
conversation = ensureimconversation(conversation, account, name)
if code == 102: # show me
- window = gaim.GaimConversationGetWindow(conversation)
- gaim.GaimConvWindowRaise(window)
+ window = purple.PurpleConversationGetWindow(conversation)
+ purple.PurpleConvWindowRaise(window)
if code == 103: # close
- gaim.GaimConversationDestroy(conversation)
+ purple.PurpleConversationDestroy(conversation)
if code == 104: # abuse
- im = gaim.GaimConversationGetImData(conversation)
- gaim.GaimConvImSend(im, "Go away you f...")
+ im = purple.PurpleConversationGetImData(conversation)
+ purple.PurpleConvImSend(im, "Go away you f...")
def buddysignedon(buddyid):
- alias = gaim.GaimBuddyGetAlias(buddyid)
+ alias = purple.PurpleBuddyGetAlias(buddyid)
text = "%s is online" % alias
code = os.spawnlp(os.P_WAIT, "xmessage", "xmessage", "-buttons",
@@ -60,24 +60,24 @@ def buddysignedon(buddyid):
pass
if code == 102: # talk
- name = gaim.GaimBuddyGetName(buddyid)
- account = gaim.GaimBuddyGetAccount(buddyid)
- gaim.GaimConversationNew(1, account, name)
+ name = purple.PurpleBuddyGetName(buddyid)
+ account = purple.PurpleBuddyGetAccount(buddyid)
+ purple.PurpleConversationNew(1, account, name)
bus = dbus.SessionBus()
-obj = bus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
-gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
+obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
bus.add_signal_receiver(receivedimmsg,
- dbus_interface = "net.sf.gaim.GaimInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "ReceivedImMsg")
bus.add_signal_receiver(buddysignedon,
- dbus_interface = "net.sf.gaim.GaimInterface",
+ dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "BuddySignedOn")
-print "This is a simple gaim notification server."
+print "This is a simple purple notification server."
print "It shows notifications when your buddy signs on or you get an IM message."
loop = gobject.MainLoop()
diff --git a/libpurple/purple-remote b/libpurple/purple-remote
index 5308e3b94a..ce5929fff5 100755
--- a/libpurple/purple-remote
+++ b/libpurple/purple-remote
@@ -9,8 +9,8 @@ import xml.dom.minidom
xml.dom.minidom.Element.all = xml.dom.minidom.Element.getElementsByTagName
-obj = dbus.SessionBus().get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
-gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
+obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
class CheckedObject:
def __init__(self, obj):
@@ -31,7 +31,7 @@ class CheckedAttribute:
return result
def show_help():
- print """This program uses DBus to communicate with gaim.
+ print """This program uses DBus to communicate with purple.
Usage:
@@ -44,7 +44,7 @@ Each command is of one of the three types:
FunctionName(value1,value2,...)
The second and third form are provided for completeness but their use
-is not recommended; use gaim-send or gaim-send-async instead. The
+is not recommended; use purple-send or purple-send-async instead. The
second form uses introspection to find out the parameter names and
their types, therefore it is rather slow.
@@ -58,11 +58,11 @@ Examples of commands:
setstatus?status=away&message=don't disturb
quit
- GaimAccountsFindConnected?name=&protocol=prpl-jabber
- GaimAccountFindConnected(,prpl-jabber)
+ PurpleAccountsFindConnected?name=&protocol=prpl-jabber
+ PurpleAccountFindConnected(,prpl-jabber)
""" % sys.argv[0]
-cgaim = CheckedObject(gaim)
+cpurple = CheckedObject(purple)
urlregexp = r"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"
@@ -81,13 +81,13 @@ def convert(value):
def findaccount(accountname, protocolname):
try:
# prefer connected accounts
- account = cgaim.GaimAccountsFindConnected(accountname, protocolname)
+ account = cpurple.PurpleAccountsFindConnected(accountname, protocolname)
return account
except:
# try to get any account and connect it
- account = cgaim.GaimAccountsFindAny(accountname, protocolname)
- gaim.GaimAccountSetStatusVargs(account, "online", 1)
- gaim.GaimAccountConnect(account)
+ account = cpurple.PurpleAccountsFindAny(accountname, protocolname)
+ purple.PurpleAccountSetStatusVargs(account, "online", 1)
+ purple.PurpleAccountConnect(account)
return account
@@ -110,60 +110,60 @@ def execute(uri):
if command == "goim":
account = findaccount(accountname, protocol)
- conversation = cgaim.GaimConversationNew(1, account, params["screenname"])
+ conversation = cpurple.PurpleConversationNew(1, account, params["screenname"])
if "message" in params:
- im = cgaim.GaimConversationGetImData(conversation)
- gaim.GaimConvImSend(im, params["message"])
+ im = cpurple.PurpleConversationGetImData(conversation)
+ purple.PurpleConvImSend(im, params["message"])
return None
elif command == "gochat":
account = findaccount(accountname, protocol)
- connection = cgaim.GaimAccountGetConnection(account)
- return gaim.ServJoinChat(connection, params)
+ connection = cpurple.PurpleAccountGetConnection(account)
+ return purple.ServJoinChat(connection, params)
elif command == "addbuddy":
account = findaccount(accountname, protocol)
- return cgaim.GaimBlistRequestAddBuddy(account, params["screenname"],
+ return cpurple.PurpleBlistRequestAddBuddy(account, params["screenname"],
params.get("group", ""), "")
elif command == "setstatus":
- current = gaim.GaimSavedstatusGetCurrent()
+ current = purple.PurpleSavedstatusGetCurrent()
if "status" in params:
status_id = params["status"]
- status_type = gaim.GaimPrimitiveGetTypeFromId(status_id)
+ status_type = purple.PurplePrimitiveGetTypeFromId(status_id)
else:
- status_type = gaim.GaimSavedstatusGetType(current)
- status_id = gaim.GaimPrimitiveGetIdFromType(status_type)
+ status_type = purple.PurpleSavedstatusGetType(current)
+ status_id = purple.PurplePrimitiveGetIdFromType(status_type)
if "message" in params:
message = params["message"];
else:
- message = gaim.GaimSavedstatusGetMessage(current)
+ message = purple.PurpleSavedstatusGetMessage(current)
if "account" in params:
- accounts = [cgaim.GaimAccountsFindAny(accountname, protocol)]
+ accounts = [cpurple.PurpleAccountsFindAny(accountname, protocol)]
for account in accounts:
- status = gaim.GaimAccountGetStatus(account, status_id)
- type = gaim.GaimStatusGetType(status)
- gaim.GaimSavedstatusSetSubstatus(current, account, type, message)
- gaim.GaimSavedstatusActivateForAccount(current, account)
+ status = purple.PurpleAccountGetStatus(account, status_id)
+ type = purple.PurpleStatusGetType(status)
+ purple.PurpleSavedstatusSetSubstatus(current, account, type, message)
+ purple.PurpleSavedstatusActivateForAccount(current, account)
else:
- accounts = gaim.GaimAccountsGetAllActive()
- saved = gaim.GaimSavedstatusNew("", status_type)
- gaim.GaimSavedstatusSetMessage(saved, message)
- gaim.GaimSavedstatusActivate(saved)
+ accounts = purple.PurpleAccountsGetAllActive()
+ saved = purple.PurpleSavedstatusNew("", status_type)
+ purple.PurpleSavedstatusSetMessage(saved, message)
+ purple.PurpleSavedstatusActivate(saved)
return None
elif command == "getinfo":
account = findaccount(accountname, protocol)
- connection = cgaim.GaimAccountGetConnection(account)
- return gaim.ServGetInfo(connection, params["screenname"])
+ connection = cpurple.PurpleAccountGetConnection(account)
+ return purple.ServGetInfo(connection, params["screenname"])
elif command == "quit":
- return gaim.GaimCoreQuit()
+ return purple.PurpleCoreQuit()
elif command == "uri":
return None
@@ -180,7 +180,7 @@ def execute(uri):
fargs = []
for arg in args:
fargs.append(convert(arg.strip()))
- return gaim.__getattr__(name)(*fargs)
+ return purple.__getattr__(name)(*fargs)
else:
# introspect the object to get parameter names and types
# this is slow because the entire introspection info must be downloaded
@@ -200,7 +200,7 @@ def execute(uri):
methodparams.append(int(value))
else:
raise "Don't know how to handle type \"%s\"" % type
- return gaim.__getattr__(command)(*methodparams)
+ return purple.__getattr__(command)(*methodparams)
show_help()
raise "Unknown command: %s" % command
diff --git a/libpurple/purple-send b/libpurple/purple-send
index 394a364fde..880954b617 100755
--- a/libpurple/purple-send
+++ b/libpurple/purple-send
@@ -5,8 +5,8 @@ METHOD_NAME=$1
if test -z "$METHOD_NAME"
then
cat <<EOF
-This program calls gaim API functions using DBus and prints the return value.
-If you are not interested in the return value, use gaim-send-async.
+This program calls purple API functions using DBus and prints the return value.
+If you are not interested in the return value, use purple-send-async.
Usage:
@@ -17,9 +17,9 @@ to specify the parameters.
Examples:
- $0 GaimAccountsFindConnected string: string:prpl-jabber
- $0 GaimAccountsGetAll
- $0 GaimCoreQuit
+ $0 PurpleAccountsFindConnected string: string:prpl-jabber
+ $0 PurpleAccountsGetAll
+ $0 PurpleCoreQuit
Use dbus-viewer to get the list of supported functions and their parameters.
EOF
@@ -27,6 +27,6 @@ EOF
fi
shift
-dbus-send --dest=net.sf.gaim.GaimService --print-reply --type=method_call /net/sf/gaim/GaimObject net.sf.gaim.GaimInterface.$METHOD_NAME "$@"
+dbus-send --dest=im.pidgin.purple.PurpleService --print-reply --type=method_call /im/pidgin/purple/PurpleObject im.pidgin.purple.PurpleInterface.$METHOD_NAME "$@"
echo
diff --git a/libpurple/purple-send-async b/libpurple/purple-send-async
index ed28825a4f..c78c0606ee 100755
--- a/libpurple/purple-send-async
+++ b/libpurple/purple-send-async
@@ -5,7 +5,7 @@ METHOD_NAME=$1
if test -z "$METHOD_NAME"
then
cat <<EOF
-This program calls gaim API functions using DBus. As opposed to gaim-send,
+This program calls purple API functions using DBus. As opposed to purple-send,
it does not print the return value.
Usage:
@@ -17,7 +17,7 @@ to specify the parameters.
Examples:
- $0 GaimCoreQuit
+ $0 PurpleCoreQuit
Use dbus-viewer to get the list of supported functions and their parameters.
EOF
@@ -25,6 +25,6 @@ EOF
fi
shift
-dbus-send --dest=net.sf.gaim.GaimService --type=method_call /net/sf/gaim/GaimObject net.sf.gaim.GaimInterface.$METHOD_NAME "$@"
+dbus-send --dest=im.pidgin.purple.PurpleService --type=method_call /im/pidgin/purple/PurpleObject im.pidgin.purple.PurpleInterface.$METHOD_NAME "$@"
echo
diff --git a/libpurple/purple-url-handler b/libpurple/purple-url-handler
index a663af179a..07215ef0a7 100755
--- a/libpurple/purple-url-handler
+++ b/libpurple/purple-url-handler
@@ -6,8 +6,8 @@ import sys
import time
import urllib
-obj = dbus.SessionBus().get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
-gaim = dbus.Interface(obj, "net.sf.gaim.GaimInterface")
+obj = dbus.SessionBus().get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
+purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
class CheckedObject:
def __init__(self, obj):
@@ -27,7 +27,7 @@ class CheckedAttribute:
raise "Error: " + self.attr + " " + str(args) + " returned " + str(result)
return result
-cgaim = CheckedObject(gaim)
+cpurple = CheckedObject(purple)
def extendlist(list, length, fill):
if len(list) < length:
@@ -44,42 +44,42 @@ def convert(value):
def findaccount(protocolname, accountname=""):
try:
# prefer connected accounts
- account = cgaim.GaimAccountsFindConnected(accountname, protocolname)
+ account = cpurple.PurpleAccountsFindConnected(accountname, protocolname)
return account
except:
# try to get any account and connect it
- account = cgaim.GaimAccountsFindAny(accountname, protocolname)
- gaim.GaimAccountSetStatusVargs(account, "online", 1)
- gaim.GaimAccountConnect(account)
+ account = cpurple.PurpleAccountsFindAny(accountname, protocolname)
+ purple.PurpleAccountSetStatusVargs(account, "online", 1)
+ purple.PurpleAccountConnect(account)
return account
def goim(account, screenname, message=None):
- # XXX: 1 == GAIM_CONV_TYPE_IM
- conversation = cgaim.GaimConversationNew(1, account, screenname)
+ # XXX: 1 == PURPLE_CONV_TYPE_IM
+ conversation = cpurple.PurpleConversationNew(1, account, screenname)
if message:
- gaim.GaimConvSendConfirm(conversation, message)
+ purple.PurpleConvSendConfirm(conversation, message)
def gochat(account, params, message=None):
- connection = cgaim.GaimAccountGetConnection(account)
- gaim.ServJoinChat(connection, params)
+ connection = cpurple.PurpleAccountGetConnection(account)
+ purple.ServJoinChat(connection, params)
if message != None:
for i in range(20):
- # XXX: 2 == GAIM_CONV_TYPE_CHAT
- conversation = gaim.GaimFindConversationWithAccount(2, params.get("channel", params.get("room")), account)
+ # XXX: 2 == PURPLE_CONV_TYPE_CHAT
+ conversation = purple.PurpleFindConversationWithAccount(2, params.get("channel", params.get("room")), account)
if conversation:
- gaim.GaimConvSendConfirm(conversation, message)
+ purple.PurpleConvSendConfirm(conversation, message)
break
else:
time.sleep(0.5)
def addbuddy(account, screenname, group="", alias=""):
- cgaim.GaimBlistRequestAddBuddy(account, screenname, group, alias)
+ cpurple.PurpleBlistRequestAddBuddy(account, screenname, group, alias)
def aim(uri):
- protocol = "prpl-oscar"
- match = re.match(r"^(aim|icq):([^?]*)(\?(.*))", uri)
+ protocol = "prpl-aim"
+ match = re.match(r"^(aim):([^?]*)(\?(.*))", uri)
if not match:
print "Invalid aim URI: %s" % uri
return
@@ -115,7 +115,30 @@ def gg(uri):
goim(account, screenname)
def icq(uri):
- aim(uri)
+ protocol = "prpl-icq"
+ match = re.match(r"^(icq):([^?]*)(\?(.*))", uri)
+ if not match:
+ print "Invalid aim URI: %s" % uri
+ return
+
+ command = urllib.unquote_plus(match.group(2))
+ paramstring = match.group(4)
+ params = {}
+ if paramstring:
+ for param in paramstring.split("&"):
+ key, value = extendlist(param.split("=", 1), 2, "")
+ params[key] = urllib.unquote_plus(value)
+ accountname = params.get("account", "")
+ screenname = params.get("screenname", "")
+
+ account = findaccount(protocol, accountname)
+
+ if command.lower() == "goim":
+ goim(account, screenname, params.get("message"))
+ elif command.lower() == "gochat":
+ gochat(account, params)
+ elif command.lower() == "addbuddy":
+ addbuddy(account, screenname, params.get("group", ""))
def irc(uri):
protocol = "prpl-irc"
diff --git a/pidgin.spec.in b/pidgin.spec.in
index cbe8e90d20..226f1cd196 100644
--- a/pidgin.spec.in
+++ b/pidgin.spec.in
@@ -374,7 +374,7 @@ fi
%{_bindir}/purple-send-async
%{_bindir}/purple-url-handler
%{_libdir}/libpurple-client.so.*
-%{_datadir}/dbus-1/services/gaim.service
+%{_datadir}/dbus-1/services/purple.service
%doc README.dbus
%doc libpurple/purple-notifications-example
%endif