How to use the matrix-appservice-bridge.StoredEvent function in matrix-appservice-bridge

To help you get started, we’ve selected a few matrix-appservice-bridge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matrix-org / matrix-appservice-slack / src / datastore / NedbDatastore.ts View on Github external
public async upsertEvent(roomIdOrEntry: string|EventEntry,
                             eventId?: string, channelId?: string, ts?: string, extras?: EventEntryExtra): Promise {
        let storeEv: StoredEvent;
        if (typeof(roomIdOrEntry) === "string") {
            storeEv = new StoredEvent(
                roomIdOrEntry,
                eventId,
                channelId,
                ts,
                extras,
            );
        } else {
            const entry = roomIdOrEntry as EventEntry;
            storeEv = new StoredEvent(
                entry.roomId,
                entry.eventId,
                entry.slackChannelId,
                entry.slackTs,
                entry._extras,
            );
        }
github matrix-org / matrix-appservice-slack / src / datastore / NedbDatastore.ts View on Github external
public async upsertEvent(roomIdOrEntry: string|EventEntry,
                             eventId?: string, channelId?: string, ts?: string, extras?: EventEntryExtra): Promise {
        let storeEv: StoredEvent;
        if (typeof(roomIdOrEntry) === "string") {
            storeEv = new StoredEvent(
                roomIdOrEntry,
                eventId,
                channelId,
                ts,
                extras,
            );
        } else {
            const entry = roomIdOrEntry as EventEntry;
            storeEv = new StoredEvent(
                entry.roomId,
                entry.eventId,
                entry.slackChannelId,
                entry.slackTs,
                entry._extras,
            );
        }
        await this.eventStore.upsertEvent(storeEv);
    }