{
silc_free(keys);
}
+
+/* Sets away `message'. The away message may be set when the client's
+ mode is changed to SILC_UMODE_GONE and the client whishes to reply
+ to anyone who sends private message. The `message' will be sent
+ automatically back to the the client who send private message. If
+ away message is already set this replaces the old message with the
+ new one. If `message' is NULL the old away message is removed.
+ The sender may freely free the memory of the `message'. */
+
+void silc_client_set_away_message(SilcClient client,
+ SilcClientConnection conn,
+ char *message)
+{
+ if (!message && conn->away) {
+ silc_free(conn->away->away);
+ silc_free(conn->away);
+ conn->away = NULL;
+ }
+
+ if (message) {
+ if (!conn->away)
+ conn->away = silc_calloc(1, sizeof(*conn->away));
+ if (conn->away->away)
+ silc_free(conn->away->away);
+ conn->away->away = strdup(message);
+ }
+}