X-Git-Url: https://git.cworth.org/git?p=loudgame;a=blobdiff_plain;f=loudgame.c;h=e2f0af2d5b751968725dfdd427b2e08b93e8f059;hp=53b392b1b0d9440f97da8162b204cae85b8e3123;hb=1b9383bc1758fa4b49ab029c730b7ba434b0f7ad;hpb=067f67d8b3d5b4a05c406f23e8129eb08413eb2f diff --git a/loudgame.c b/loudgame.c index 53b392b..e2f0af2 100644 --- a/loudgame.c +++ b/loudgame.c @@ -70,11 +70,10 @@ connection_open_cb (LmConnection *connection, gboolean result, loudgame_t *lg) authentication_cb, lg, FALSE, NULL); } -static void -send_reply (LmConnection *connection, - const char *peer, - const char *message, - loudgame_t *lg) +void +loudgame_send (loudgame_t *lg, + const char *peer, + const char *message) { LmMessage *reply; gboolean result; @@ -84,11 +83,12 @@ send_reply (LmConnection *connection, lm_message_node_add_child (reply->node, "body", message); - result = lm_connection_send (connection, reply, &error); + result = lm_connection_send (lg->connection, reply, &error); lm_message_unref (reply); if (! result) { - g_error ("lm_connection_send failed: error->message"); + g_error ("lm_connection_send failed: %s\n", + error->message); loudgame_quit (lg, 1); } } @@ -107,7 +107,7 @@ handle_command (LmConnection *connection, } error = g_strdup_printf ("Unknown command: '%s'", command); - send_reply (connection, peer, error, lg); + loudgame_send (lg, peer, error); free (error); }