Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
prepare 1.79.2
Browse files Browse the repository at this point in the history
fix standalone context:
configure promise would not return, ALL event did not contain event name
  • Loading branch information
Simon-Laux committed May 2, 2022
1 parent 60cfb28 commit b887df9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased][unreleased]

## [1.79.2] - 2022-05-02

### Fixed
- fix standalone context: configure promise would not return, ALL event did not contain event name

## [1.79.1] - 2022-05-02

### Fixed
Expand Down Expand Up @@ -1450,7 +1455,9 @@ const { C } = require('deltachat-node')

- Remove `dc_msg_has_deviating_timestamp` prototype [**@link2xt**](https://github.com/link2xt)

[unreleased]: https://github.com/deltachat/deltachat-node/compare/v1.79.1...HEAD
[unreleased]: https://github.com/deltachat/deltachat-node/compare/v1.79.2...HEAD

[1.79.2]: https://github.com/deltachat/deltachat-node/compare/v1.79.1...v1.79.2

[1.79.1]: https://github.com/deltachat/deltachat-node/compare/v1.79.0...v1.79.1

Expand Down
20 changes: 14 additions & 6 deletions lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class Context extends EventEmitter {
return
}
context.emit(eventString, data1, data2)
context.emit('ALL', data1, data2)
context.emit('ALL', eventString, data1, data2)
}
binding.dcn_start_event_handler(
context.dcn_context,
Expand Down Expand Up @@ -171,12 +171,20 @@ export class Context extends EventEmitter {
reject(new Error(error))
}

const onConfigure = (accountId: number, data1: number, data2: string) => {
if (this.account_id !== accountId) {
return
let onConfigure: (...args: any[]) => void
if (this.account_id === null) {
onConfigure = (data1: number, data2: string) => {
if (data1 === 0) return onFail(data2)
else if (data1 === 1000) return onSuccess()
}
} else {
onConfigure = (accountId: number, data1: number, data2: string) => {
if (this.account_id !== accountId) {
return
}
if (data1 === 0) return onFail(data2)
else if (data1 === 1000) return onSuccess()
}
if (data1 === 0) return onFail(data2)
else if (data1 === 1000) return onSuccess()
}

const removeListeners = () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deltachat-node",
"version": "1.79.1",
"version": "1.79.2",
"description": "node.js bindings for deltachat-core",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit b887df9

Please sign in to comment.