X-Git-Url: https://gitweb.ps.run/matrix_esp_thesis/blobdiff_plain/464bfb1912d0806143386f61c33dd45fbafc38e8..07e667e29883740aa0b82199cf0518a2e2684e26:/examples/Cli.c?ds=inline diff --git a/examples/Cli.c b/examples/Cli.c index b2fbe45..4a8e571 100644 --- a/examples/Cli.c +++ b/examples/Cli.c @@ -133,8 +133,6 @@ ExecuteCommand( "{\"body\":\"%s\",\"msgtype\":\"m.text\"}", args[1]); - printf("Sending %s to %s\n", body, args[0]); - MatrixClientSendEvent(client, args[0], "m.room.message", @@ -148,6 +146,43 @@ ExecuteCommand( else if (CheckCommand(cmd, "getuserid")) { printf("User ID: %s\n", client->userId); } + else if (CheckCommand(cmd, "sendencrypted")) { + CHECK_ARGS(2, " ") + + static char body[1024]; + snprintf(body, 1024, + "{\"body\":\"%s\",\"msgtype\":\"m.text\"}", + args[1]); + + MatrixClientSendEventEncrypted(client, + args[0], + "m.room.message", + body); + } + else if (CheckCommand(cmd, "sharesession")) { + CHECK_ARGS(2, " ") + + MatrixClientShareMegolmOutSession(&client, + args[0], + args[1], + &client->megolmOutSessions[0]); + } + else if (CheckCommand(cmd, "savesession")) { + CHECK_ARGS(2, " ") + + MatrixMegolmOutSessionSave( + &client->megolmOutSessions[0], + args[0], + args[1]); + } + else if (CheckCommand(cmd, "loadsession")) { + CHECK_ARGS(2, " ") + + MatrixMegolmOutSessionLoad( + &client->megolmOutSessions[0], + args[0], + args[1]); + } #undef CHECK_ARGS }