fix fromMe in chat.fetchMessages (#2314)

* fix fromMe

* Fix Test

* fix crash in getchat

---------

Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
This commit is contained in:
Roi Greenberg 2023-08-08 18:16:02 +03:00 • committed by GitHub
commit 096e84b0a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,7 @@ class Chat extends Base {
if (m.isNotification) {
return false; // dont include notification messages
}
if (searchOptions && searchOptions.fromMe && m.id.fromMe !== searchOptions.fromMe) {
if (searchOptions && searchOptions.fromMe !== undefined && m.id.fromMe !== searchOptions.fromMe) {
return false;
}
return true;