python, dbus and pointers help.

G

Glich

'''
hello, using pidgin instant messenger I can get the value of 'message'
when one is being sent but,
I dont know how to chage the value of message.

from the documentation (http://developer.pidgin.im/doxygen/dev/html/
conversation-signals.html#sending-im-msg):
_____________________________
sending-im-msg:

Emitted before sending an IM to a user. message is a pointer to the
message string, so the plugin can replace the message before being
sent.
_____________________________

I think python get's a copy of the message (this is just a guess). How
can I change the message before it is sent?

Thanks.
The code is taken from http://developer.pidgin.im/wiki/DbusHowto#Furtherreading
and changed only a small amount.
'''

#!/usr/bin/env python

def cb_func(account, rec, message):
#change message here somehow?
print message

import dbus, gobject
from dbus.mainloop.glib import DBusGMainLoop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()

bus.add_signal_receiver(cb_func,

dbus_interface="im.pidgin.purple.PurpleInterface",
signal_name="SendingImMsg")

loop = gobject.MainLoop()
loop.run()
 
G

Glich

or a way of letting me see the message then cancel sending it then I
could create a new message and send that one. but I cant see this in
the documentation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top