Skip to content

A forwarded message ​

forwardMessage({ fromThreadId, fromItemId }) builds the message; DirectBroadcast sends it to a conversation. Forwards one message of another conversation. The 451 app sends it from the forwarding sheet (direct_thread is the attribution that form carries), so a screen's forward() opens the sheet and the picked row's send() is this broadcast.

On a message of a conversation it is the message's own forward() — it opens the forwarding sheet — and the picked row's send().

The sheet's form carries no send_silently, is_x_transport_forward or is_shh_mode, so a forward sent with DirectBroadcast leaves them out unless you pass sendSilently, isXTransportForward or isShhMode; what you pass is laid out, as are your extras, never dropped.

The forward sheetforward(): the conversations the app holds, from its local inbox store.

The conversation after the forwardAfter the row's send(): the sheet closes back to the conversation the message was forwarded from.

Example ​

Forward a message of one conversation into another. The example starts the app from a stored snapshot and sends over the layer, so its answer is the broadcast's: the server's response beside the client_context the request minted.

ts
import { AndroidApp } from '@igpapi/android';
import { DirectBroadcast, forwardMessage, ThreadDirectTargetConfiguration } from '@igpapi/mobile';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';

// A snapshot read back from your storage (see "Keep a session").
const snapshot = JSON.parse(await readFile('snapshot.json', 'utf8'));

// Forward a message of one conversation into another: the target conversation's long
// thread id, and the source conversation's thread id and the message's item id.
const forward = DirectBroadcast({
  target: new ThreadDirectTargetConfiguration('340282366841710300949128000000000002'),
  message: forwardMessage({
    fromThreadId: '340282366841710300949128000000000001',
    fromItemId: '30000000000000000000000000000000001',
  }),
  sendAttribution: 'direct_thread',
});

// One build of the layer is one app process; the program runs over it.
const sent = await Effect.runPromise(Effect.provide(forward, AndroidApp({ snapshot })));
console.log(sent.client_context);

The pages of this site are the README files of the repository. The API reference is generated from the source.