- MatrixMegolmInSession * megolmInSession;
- while (! MatrixClientGetMegolmInSession(client,
- ROOM_ID, strlen(ROOM_ID),
- SESSION_ID, strlen(SESSION_ID),
- &megolmInSession))
- Sync(client, syncBuffer);
+
+ // int c;
+ // while ((c=getchar()) != 'q') {
+ // vTaskDelay(1000/portTICK_PERIOD_MS);
+
+ // if (c == 's') {
+ // Sync(client, syncBuffer, SYNC_BUFFER_SIZE);
+ // }
+ // else if (c == 'm') {
+ // static const char * msgs[] = { "A", "B", "C" };
+ // static char msg[128];
+ // snprintf(msg, 128, "{\"body\":\"%s\",\"msgtype\":\"m.text\"}", msgs[rand()%(sizeof(msgs)/sizeof(msgs[0]))]);
+
+ // MatrixClientSendEventEncrypted(client,
+ // ROOM_ID,
+ // "m.room.message",
+ // msg);
+ // printf("Message sent. Message index: %d\n", (int)olm_outbound_group_session_message_index(megolmOutSession->session));
+ // }
+ // }
+
+ for (int i = 0; i < 10; i++) {
+
+ static const char * msgs[] = { "A", "B", "C" };
+ static char msg[128];
+ snprintf(msg, 128, "{\"body\":\"%s\",\"msgtype\":\"m.text\"}", msgs[rand()%(sizeof(msgs)/sizeof(msgs[0]))]);