Sample send IM script?
Etan Reisner
pidgin at unreliablesource.net
Mon Jul 2 20:07:03 EDT 2007
On Mon, Jul 02, 2007 at 04:51:54PM -0700, Parand Darugar wrote:
> Hello,
<snip>
> I start nullclient and I'm able to interact with it using D-Bus.
> Here's what I'm trying:
>
> import dbus, dbus.glib, dbus.decorators, gobject
> bus = dbus.SessionBus()
> obj = bus.get_object("im.pidgin.purple.PurpleService",
> "/im/pidgin/purple/PurpleObject")
> purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
> name = 'someaccount'
> protocol = 'prpl-yahoo'
> ac = purple.PurpleAccountsFind(name, protocol) # returns a non-zero value
> conversation = purple.PurpleConversationNew(1, ac, name) #
> conversation returns 0
> im = purple.PurpleConversationGetImData(conversation) # im is also 0
> purple.PurpleConvImSend(im, "hello there")
>
> Do I need some sort of connection or something after I find the
> account to make this go?
>
> Much thanks,
>
> Parand
Have you set up that account in the nullclient? Is it signed on when you
try this script?
If the account isn't online you are going to need to connect it before you
can create a conversation. For reference you can look at what the
purple-remote script does for the goim command.
-Etan
More information about the Devel
mailing list