X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ftp_send_debug.py;h=b5d5a7e8746145bf5f0736bbaf1c1cd898e54333;hb=a151f4c07f375b0c39f36685489591386e9ef6ca;hp=2db0a131ecbf375ac7043dc462b38d3ae9c7c33c;hpb=3120896a0481c0c6f453215c31f7f560b0d44668;p=theonering diff --git a/src/tp_send_debug.py b/src/tp_send_debug.py index 2db0a13..b5d5a7e 100755 --- a/src/tp_send_debug.py +++ b/src/tp_send_debug.py @@ -110,13 +110,21 @@ def _on_ensure(acct, conn, message, yours, channelObjectPath, properties): channel[telepathy.server.CHANNEL_TYPE_TEXT].Send( telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, message, - reply_handler = lambda: _on_send(acct, conn, channel), + reply_handler = lambda: _on_send(channel), error_handler = _on_error, ) -def _on_send(acct, conn, channel): +def _on_send(channel): print "Message sent" + channel[telepathy.server.CHANNEL].Close( + reply_handler = _on_channel_closed, + error_handler = _on_error, + ) + + +def _on_channel_closed(): + print "Channel Closed" loop.quit()