--- 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);