diff --git a/JS/index.js b/JS/index.js index 822408e..afb6e79 100644 --- a/JS/index.js +++ b/JS/index.js @@ -437,7 +437,7 @@ class iMessageGraphClientClass { try { - message = message.replaceAll('"', '') + message = encodeURIComponent(message) result = await client.query({ query: gql`query sendMessage { @@ -457,7 +457,9 @@ class iMessageGraphClientClass { let messages = result.data.sendMessage - return splitMessages(messages) + storedArgsAndResults.getMessages.output = splitMessages(messages) + + return storedArgsAndResults.getMessages.output } async getChats () { @@ -628,10 +630,10 @@ class iMessageClient { return } - // if (DEBUG) { + if (DEBUG) { console.log(`${intervalDate}: running...`) - // } + } try { @@ -651,10 +653,10 @@ class iMessageClient { console.log(error) } - // if (DEBUG) { + if (DEBUG) { console.log(`${intervalDate}: complete!`) - // } + } }, 3000) } @@ -687,9 +689,11 @@ class iMessageClient { async sendMessage (chatId, message) { - console.log(`iMessageClient.sendMessage`) + console.log(`iMessageClient.sendMessage(${chatId}, ${message})`) - return await iMessageGraphClient.sendMessage(chatId, message) + const messages = await iMessageGraphClient.sendMessage(chatId, message) + + return messages } async getChats () { diff --git a/dist/MessagesForMacintosh.dsk b/dist/MessagesForMacintosh.dsk index 532edfa..9067899 100644 Binary files a/dist/MessagesForMacintosh.dsk and b/dist/MessagesForMacintosh.dsk differ diff --git a/dist/MessagesForMacintosh.zip b/dist/MessagesForMacintosh.zip index adf82e7..860cb2b 100644 Binary files a/dist/MessagesForMacintosh.zip and b/dist/MessagesForMacintosh.zip differ diff --git a/mac_main.c b/mac_main.c index e96c13e..d52880f 100644 --- a/mac_main.c +++ b/mac_main.c @@ -163,7 +163,7 @@ int main() coprocessorLoaded = 1; - EventLoop(ctx); /* call the main event loop */ + EventLoop(ctx); return 0; } @@ -249,14 +249,14 @@ void EventLoop(struct nk_context *ctx) GlobalToLocal(&tempPoint); if (!beganInput) { + nk_input_begin(ctx); + beganInput = true; } nk_input_motion(ctx, tempPoint.h, tempPoint.v); firstOrMouseMove = true; - beganInput = true; - mouse_x = tempPoint.h; mouse_y = tempPoint.v; @@ -366,12 +366,12 @@ void EventLoop(struct nk_context *ctx) writeSerialPortDebug(boutRefNum, "nk_input_render complete"); #endif - + // again, don't do this // #ifdef PROFILING // PROFILE_END("eventloop"); // #endif } while ( true ); /* loop forever; we quit via ExitToShell */ -} /*EventLoop*/ +} /* Do the right thing for an event. Determine what kind of event it is, and call