view libpurple/purple-send @ 24542:2cae2b346d72

Various nullprpl fixes. This stemmed from a complaint from a user in #pidgin that it crashed if the user didn't change the room from "default" to something else when joining. Nothing big here, but here's the list: * Make a bunch of strings const for good measure * g_strdup strings that the caller is supposed to be freeing (one of these almost certainly fixes the aforementioned crash) * Use g_list_prepend/g_list_reverse * Don't leak some strings * g_* needs g_free, not free (this might also be the one fixing the crash) Fixes #7712. committer: John Bailey <rekkanoryo@rekkanoryo.org>
author Paul Aurich <paul@darkrain42.org>
date Sat, 06 Dec 2008 05:05:02 +0000
parents 942bf314fc8a
children cea56d000b16
line wrap: on
line source

#!/bin/sh

METHOD_NAME=$1

if test -z "$METHOD_NAME" 
then
    cat <<EOF 
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:

   $0 method-name type1:parameter1 type2:parameter2 ...

This shell script just invokes dbus-send, see man dbus-send for how 
to specify the parameters.  

Examples:

   $0 PurpleAccountsFindConnected string: string:prpl-jabber
   $0 PurpleAccountsGetAll
   $0 PurpleCoreQuit

Use dbus-viewer to get the list of supported functions and their parameters.
EOF
    exit 1
fi

shift
dbus-send --dest=im.pidgin.purple.PurpleService --print-reply --type=method_call /im/pidgin/purple/PurpleObject im.pidgin.purple.PurpleInterface.$METHOD_NAME "$@"

echo