LmMessage *m,
gpointer user_data)
{
+ LmMessage *reply;
+ gboolean result;
+ GError *error = NULL;
+ LmMessageNode *body;
+
g_print ("Incoming message from: %s\n",
lm_message_node_get_attribute (m->node, "from"));
+
+ reply = lm_message_new (lm_message_node_get_attribute (m->node, "from"),
+ LM_MESSAGE_TYPE_MESSAGE);
+ body = lm_message_node_get_child (m->node, "body");
+ lm_message_node_add_child (reply->node, "body",
+ lm_message_node_get_value (body));
+
+ result = lm_connection_send (connection, reply, &error);
+ lm_message_unref (reply);
+
+ if (! result) {
+ g_error ("lm_connection_send failed");
+ }
return LM_HANDLER_RESULT_REMOVE_MESSAGE;
}