# HG changeset patch # User Stiletto # Date 1351024651 -14400 # Node ID a49fb1ec5e2a5e1863587bd587bf6d851922d5c6 # Parent 0d97b0d61ed2ffe88cf032ffedf7a21749d1860f Send a reason when interrupted by sigint diff -r 0d97b0d61ed2 -r a49fb1ec5e2a iswydt.vala --- a/iswydt.vala Wed Oct 24 00:37:04 2012 +0400 +++ b/iswydt.vala Wed Oct 24 00:37:31 2012 +0400 @@ -127,7 +127,13 @@ _change_state(State.DISCONNECTED, e.message); } } - public void close() { + public void close(string reason) { + if ((state==State.CONNECTED)&&(reason != null)) { + var prs = new Lm.Message(null, Lm.MessageType.PRESENCE); + prs.node.set_attribute("type","unavailable"); + prs.node.add_child("status",reason); + cn.send(prs); + } cn.close(); } } @@ -173,7 +179,7 @@ if (news == Connection.State.DISCONNECTED) loop.quit(); }); - account.close(); + account.close("Received SIGINT"); } }); Posix.sigaction(Posix.SIGINT, action, null);