mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
pull latest changes from deltachat-node
This commit is contained in:
@@ -2,6 +2,34 @@
|
|||||||
|
|
||||||
## [Unreleased][unreleased]
|
## [Unreleased][unreleased]
|
||||||
|
|
||||||
|
## [1.79.3] - 2022-05-03
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- fix standalone context: configure promise would still not return (wrong account id)
|
||||||
|
|
||||||
|
## [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
|
||||||
|
- don't ignore core sourcefiles, prevented npm installation on architectures with no prebuild
|
||||||
|
|
||||||
|
## [1.79.0] - 2022-05-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Upgrade to deltachat-core version `1.79.0`
|
||||||
|
|
||||||
|
## [1.78.0] - 2022-05-02
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Upgrade to deltachat-core version `1.78.0`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- fix standalone (without account manager) context events (remove accountid, and add `ALL` event)
|
||||||
|
|
||||||
## [1.77.1] - 2022-04-26
|
## [1.77.1] - 2022-04-26
|
||||||
|
|
||||||
### BREAKING: we now use node 16
|
### BREAKING: we now use node 16
|
||||||
@@ -13,7 +41,7 @@ Please update if you use an older version! ([`nvm`](https://github.com/nvm-sh/nv
|
|||||||
- move `Context.getSystemInfo()` to `AccountManager.getSystemInfo()`
|
- move `Context.getSystemInfo()` to `AccountManager.getSystemInfo()`
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- fix that context was not usable standalone without account managrer anymore.
|
- fix that context was not usable standalone without account manager anymore.
|
||||||
|
|
||||||
## [1.77.0] - 2022-04-14
|
## [1.77.0] - 2022-04-14
|
||||||
|
|
||||||
@@ -1432,9 +1460,19 @@ const { C } = require('deltachat-node')
|
|||||||
|
|
||||||
- Remove `dc_msg_has_deviating_timestamp` prototype [**@link2xt**](https://github.com/link2xt)
|
- Remove `dc_msg_has_deviating_timestamp` prototype [**@link2xt**](https://github.com/link2xt)
|
||||||
|
|
||||||
[unreleased]: https://github.com/deltachat/deltachat-node/compare/v1.77.1...HEAD
|
[unreleased]: https://github.com/deltachat/deltachat-node/compare/v1.79.3...HEAD
|
||||||
|
|
||||||
[1.77.1]: https://github.com/deltachat/deltachat-node/compare/v1.76.0...v1.77.1
|
[1.79.3]: https://github.com/deltachat/deltachat-node/compare/v1.79.2...v1.79.3
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
||||||
|
[1.79.0]: https://github.com/deltachat/deltachat-node/compare/v1.78.0...v1.79.0
|
||||||
|
|
||||||
|
[1.78.0]: https://github.com/deltachat/deltachat-node/compare/v1.77.1...v1.78.0
|
||||||
|
|
||||||
|
[1.77.1]: https://github.com/deltachat/deltachat-node/compare/v1.77.0...v1.77.1
|
||||||
|
|
||||||
[1.77.0]: https://github.com/deltachat/deltachat-node/compare/v1.76.0...v1.77.0
|
[1.77.0]: https://github.com/deltachat/deltachat-node/compare/v1.76.0...v1.77.0
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export class Context extends EventEmitter {
|
|||||||
constructor(
|
constructor(
|
||||||
readonly manager: AccountManager | null,
|
readonly manager: AccountManager | null,
|
||||||
private inner_dcn_context: NativeContext,
|
private inner_dcn_context: NativeContext,
|
||||||
readonly account_id: number
|
readonly account_id: number | null
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
debug('DeltaChat constructor')
|
debug('DeltaChat constructor')
|
||||||
@@ -37,7 +37,7 @@ export class Context extends EventEmitter {
|
|||||||
* automatically starts the event handler */
|
* automatically starts the event handler */
|
||||||
static open(cwd: string): Context {
|
static open(cwd: string): Context {
|
||||||
const dbFile = join(cwd, 'db.sqlite')
|
const dbFile = join(cwd, 'db.sqlite')
|
||||||
const context = new Context(null, binding.dcn_context_new(dbFile), 42)
|
const context = new Context(null, binding.dcn_context_new(dbFile), null)
|
||||||
debug('Opened context')
|
debug('Opened context')
|
||||||
function handleCoreEvent(
|
function handleCoreEvent(
|
||||||
eventId: number,
|
eventId: number,
|
||||||
@@ -48,10 +48,11 @@ export class Context extends EventEmitter {
|
|||||||
debug(eventString, data1, data2)
|
debug(eventString, data1, data2)
|
||||||
if (!context.emit) {
|
if (!context.emit) {
|
||||||
console.log('Received an event but EventEmitter is already destroyed.')
|
console.log('Received an event but EventEmitter is already destroyed.')
|
||||||
console.log(eventString, 42, data1, data2)
|
console.log(eventString, data1, data2)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
context.emit(eventString, 42, data1, data2)
|
context.emit(eventString, data1, data2)
|
||||||
|
context.emit('ALL', eventString, data1, data2)
|
||||||
}
|
}
|
||||||
binding.dcn_start_event_handler(
|
binding.dcn_start_event_handler(
|
||||||
context.dcn_context,
|
context.dcn_context,
|
||||||
@@ -170,13 +171,21 @@ export class Context extends EventEmitter {
|
|||||||
reject(new Error(error))
|
reject(new Error(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
const onConfigure = (accountId: number, data1: number, data2: string) => {
|
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) {
|
if (this.account_id !== accountId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (data1 === 0) return onFail(data2)
|
if (data1 === 0) return onFail(data2)
|
||||||
else if (data1 === 1000) return onSuccess()
|
else if (data1 === 1000) return onSuccess()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const removeListeners = () => {
|
const removeListeners = () => {
|
||||||
;(this.manager || this).removeListener(
|
;(this.manager || this).removeListener(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "deltachat-node",
|
"name": "deltachat-node",
|
||||||
"version": "1.77.1",
|
"version": "1.79.3",
|
||||||
"description": "node.js bindings for deltachat-core",
|
"description": "node.js bindings for deltachat-core",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user