fix issue where return value from sendMessage would not make it back through to mac app

This commit is contained in:
camh 2022-02-04 23:30:50 -08:00
parent cfcf7566f5
commit dfe9dd565a
4 changed files with 17 additions and 13 deletions

View File

@ -437,7 +437,7 @@ class iMessageGraphClientClass {
try { try {
message = message.replaceAll('"', '') message = encodeURIComponent(message)
result = await client.query({ result = await client.query({
query: gql`query sendMessage { query: gql`query sendMessage {
@ -457,7 +457,9 @@ class iMessageGraphClientClass {
let messages = result.data.sendMessage let messages = result.data.sendMessage
return splitMessages(messages) storedArgsAndResults.getMessages.output = splitMessages(messages)
return storedArgsAndResults.getMessages.output
} }
async getChats () { async getChats () {
@ -628,10 +630,10 @@ class iMessageClient {
return return
} }
// if (DEBUG) { if (DEBUG) {
console.log(`${intervalDate}: running...`) console.log(`${intervalDate}: running...`)
// } }
try { try {
@ -651,10 +653,10 @@ class iMessageClient {
console.log(error) console.log(error)
} }
// if (DEBUG) { if (DEBUG) {
console.log(`${intervalDate}: complete!`) console.log(`${intervalDate}: complete!`)
// } }
}, 3000) }, 3000)
} }
@ -687,9 +689,11 @@ class iMessageClient {
async sendMessage (chatId, message) { 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 () { async getChats () {

Binary file not shown.

Binary file not shown.

View File

@ -163,7 +163,7 @@ int main()
coprocessorLoaded = 1; coprocessorLoaded = 1;
EventLoop(ctx); /* call the main event loop */ EventLoop(ctx);
return 0; return 0;
} }
@ -249,14 +249,14 @@ void EventLoop(struct nk_context *ctx)
GlobalToLocal(&tempPoint); GlobalToLocal(&tempPoint);
if (!beganInput) { if (!beganInput) {
nk_input_begin(ctx); nk_input_begin(ctx);
beganInput = true;
} }
nk_input_motion(ctx, tempPoint.h, tempPoint.v); nk_input_motion(ctx, tempPoint.h, tempPoint.v);
firstOrMouseMove = true; firstOrMouseMove = true;
beganInput = true;
mouse_x = tempPoint.h; mouse_x = tempPoint.h;
mouse_y = tempPoint.v; mouse_y = tempPoint.v;
@ -366,12 +366,12 @@ void EventLoop(struct nk_context *ctx)
writeSerialPortDebug(boutRefNum, "nk_input_render complete"); writeSerialPortDebug(boutRefNum, "nk_input_render complete");
#endif #endif
// again, don't do this
// #ifdef PROFILING // #ifdef PROFILING
// PROFILE_END("eventloop"); // PROFILE_END("eventloop");
// #endif // #endif
} while ( true ); /* loop forever; we quit via ExitToShell */ } 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 /* Do the right thing for an event. Determine what kind of event it is, and call