Closed Trother555 closed 6 years ago
Now I got it. It happens in APIBuffer's constructor when calling clear().
this.pid = this.obj.peer_id
But when typing event object looks like:
{"state":"typing","from_id":162112527,"to_id":-162112527}
So may be you can add an additional if to check for it
clear () {
this.replyText = ''
this.attachment = []
if (this.eventType === 'message_allow') {
this.pid = this.obj.user_id
} else if (this.eventType === 'message_typing_state'){
this.pid = this.obj.from_id
} else {
this.pid = this.obj.peer_id
}
}
I don't know if it is a bug or it's just not meant to be used that way.
Anyway, this:
is not working like I'm expecting. It says that peer id is undefined. A possible workaround:
By the way, I can't understand why other handlers work: just can't find where pid is set for them.