if 'im.pidgin.purple.PurpleService' in bus.list_names():
    purple = bus.get_object('im.pidgin.purple.PurpleService',
        '/im/pidgin/purple/PurpleObject', 'im.pidgin.purple.PurpleInterface')
print('Connected to the pidgin DBus.')
for conv in purple.PurpleGetIms():
    purple.PurpleConvImSend(purple.PurpleConvIm(conv), 'Ignore this message.')
else:
    pass
Send and receive messages via (libpurple) messenger protocols