Commit Graph

77 Commits

Author SHA1 Message Date
Adhiraj Singh 7d7249887c fix: example TypeError 2022-09-20 12:11:56 +05:30
Adhiraj Singh bed9e384ba feat: added played receipt 2022-08-04 11:55:35 +05:30
Adhiraj Singh af1d5f6a01 feat: use store.loadMessage for getMessage in example 2022-07-16 09:42:16 +05:30
Adhiraj Singh ba486f9367 feat: include chats.delete in example 2022-07-14 11:24:15 +05:30
Adhiraj Singh 7968abb0db chore: log all messages.upsert 2022-07-04 16:58:18 +05:30
Adhiraj Singh adc2c9cab9 docs: add a bit more info about events 2022-07-04 11:40:49 +05:30
Adhiraj Singh 5cc58d4aed feat: add bulk "process" capability to BaileysBufferableEventEmitter 2022-07-04 11:34:41 +05:30
Adhiraj Singh 7421f55daa feat: implement event buffer for offline msgs
!BREAKING_CHANGE

1. this allows all offline notifications to be combined into a batch -- to reduce the number of events being sent out
2. to enable the above, the "message.reaction" event has been made an array. Also removes the need for the "operation" field
3. have also now started processing all events under a single queue to prevent state sync problems
2022-06-27 13:38:29 +05:30
Adhiraj Singh 59652a5368 feat: handle chat deletes + message stars 2022-05-25 12:12:17 +05:30
Adhiraj Singh 06437e182d feat: add "multi file auth state" implementation
1. add multi file auth state since it's far more efficient than single state
2. deprecate single file auth state (please don't use it anymore)
2022-05-22 21:21:35 +05:30
Adhiraj Singh ae4aa67950 feat: handle call events 2022-05-09 15:00:53 +05:30
Adhiraj Singh 221b95050f chore: make use of "msgRetryCounterMap" more explicit 2022-05-01 11:44:51 +05:30
Adhiraj Singh dda909eb05 feat: add "--no-store" + "--no-reply" flags to example 2022-04-13 13:20:43 +05:30
Adhiraj Singh fa49af7c24 chore: correctly add log level to examples 2022-04-02 15:44:00 +05:30
Adhiraj Singh c53a1b5cd4 chore: use correct logger in example 2022-03-24 23:57:17 +05:30
Deniz 83669df329 Make disconnect reason in example more apparent when logged out. (#1352)
* Add a warning to make people aware of what they should do about the 'Restart Required' message.

* More descriptive message when session has been logged out of.
2022-03-12 09:32:27 +05:30
Adhiraj Singh 75582e4541 feat: add WA Web version auto fetch 2022-02-20 19:43:15 +05:30
Adhiraj Singh e954fc0053 lint: examples 2022-01-22 11:37:39 +05:30
Adhiraj Singh 34d934d762 chore: update memory store location 2022-01-19 22:54:43 +05:30
Adhiraj Singh 1fb52de958 docs: update readme about store 2022-01-19 22:38:04 +05:30
Adhiraj Singh fb66733b61 feat: implement in memory store
1. the store works as a temporary store for connection data such as chats, messages & contacts
2. the store is primarily meant to illustrate the usage of the event emitter as a way to construct the state of the connection. This will likely be very inefficient to perform well at scale
3. the store is meant to be a quick way to have some visibility of data while testing
4. the store works for both legacy & MD connections
2022-01-19 21:35:59 +05:30
Adhiraj Singh 8f11f0be76 chore: add linting 2022-01-19 15:54:02 +05:30
Adhiraj Singh d8c6b0a580 chore: update legacy example logging 2021-12-24 10:27:04 +05:30
Adhiraj Singh 71a545e972 feat: add "getMessage" to example 2021-12-23 10:54:46 +05:30
Adhiraj Singh 677f50baaa feat: add contacts to chats.set event 2021-12-20 13:59:04 +05:30
Adhiraj Singh e393f0f9a8 chore: make APIs similar for legacy + MD 2021-12-18 16:44:31 +05:30
Adhiraj Singh c803e22e8a feat: functional legacy socket 2021-12-17 20:58:33 +05:30
Adhiraj Singh 3d0704a317 feat: cleaner auth state management
1. removes the "auth-state.update" event since it was bloated and fairly unnecessary
2. adds "creds.update" event that only sends the updated properties of the auth credentials
3. ensure the auth creds are not mutated anywhere, but only with the "creds.update" event
4. Separates the signal credentials from the auth credentials (kinda in progress)
5. in memory key store requires a save function to let one know when to save the keys

!BREAKING_CHANGE
2021-11-20 16:21:56 +05:30
Adhiraj Singh 8ae1cae5b2 chore: cleaner example file 2021-11-15 08:22:58 +05:30
Diego Araujo bbf5bc96cc Fix retry receipt, fix assertingPreKeys, uploadPreKeys to 30, generate QR timeout and update example (#833)
* update example

* fix assertingPreKeys, uploadPreKeys to 30, generate QR timeout, sendRetryReceipt fix

* update example, change clear qr to event connection.update

* update example

* firstQR flag

* change checkConnection qr

* update example

* remove semis

* update example
2021-11-15 08:11:39 +05:30
Adhiraj Singh 18c6b44b9a Update example.ts 2021-10-28 13:24:35 +05:30
Adhiraj Singh 723d1d6712 fire contact update if pushname provided 2021-09-27 16:48:46 +05:30
Adhiraj Singh 2c99a4a8ed read message in example 2021-09-26 22:36:36 +05:30
Adhiraj Singh 671ea3e097 remove in-memory-store 2021-09-25 17:48:27 +05:30
Adhiraj Singh f267f27ada finalize multi-device 2021-09-22 22:19:53 +05:30
Adhiraj Singh 89cf8004e9 Wrap up connection + in memory store 2021-07-09 20:35:07 +05:30
Omri Dagan e670ff003e Add support for contacts array (#384)
* Add support for contacts array

* Remove contactsArray logs from Example.ts

* Undid prettier formatting of example.js
2021-03-07 02:03:47 +05:30
Adhiraj Singh dfaeef0db1 Fix initial-data-received called multiple times
The latest android version has messages with the last: true flag set on all messages, causing incorrect events being fired off. This update creates a timeout that fires off the initial-data-received 2500ms after the last messages received.

This may not be as accurate in production but will be better than the current version
2021-02-04 19:04:50 +05:30
Adhiraj Singh 63dd136afa Move msgCount increment to generateMessageTag
Prevents duplicate tags from being sent
2021-01-24 17:25:49 +05:30
Adhiraj Singh 0344d6336c Stream uploads + downloads + allow for remote url uploads
- Switch to using got
- Use encryption/decryption streams for speed & lesser memory consumption
- Allow for stream based download & simultaneous upload of media
2021-01-13 22:48:28 +05:30
Adhiraj Singh b9ece77220 Removed loadProfilePicturesForChatsAutomatically 2021-01-05 19:08:25 +05:30
Adhiraj Singh efe6bf1dd3 Cleaner code. Remove credentials-updated & connection-validated as they became obsolete
`credentials-updated` & `connection-validated` became obsolete as they are equivalent to `open`
2021-01-04 17:07:51 +05:30
Adhiraj Singh 6cc5a910f7 Completely remove message-status-update & user-status-update 2021-01-04 14:19:44 +05:30
Adhiraj Singh ac4b4c7384 Removed deprecations + merge message-status-update into chat-update
1. Update package version to 4.0.0
2. Retry query if the connection unexpectedly closes + make query iterative instead of recursive
3. Remove message-new & message-update deprecations
4. Deprecate loadProfilePicturesForChatsAutomatically
2021-01-04 12:35:48 +05:30
Adhiraj Singh 7dc083b6e5 Update init method to try login multiple times + use WA ttl for QR gen 2020-11-26 17:08:18 +05:30
chan32167 c53b091484 Update example.ts 2020-11-22 18:45:07 -05:00
Adhiraj Singh c69d3832de Add WAChatUpdate 2020-11-18 23:41:51 +05:30
Adhiraj Singh f29c5cf206 Add name to presence update 2020-11-17 17:12:14 +05:30
Adhiraj Singh cea702b5a3 better presence handling via chat-update 2020-11-17 16:58:57 +05:30
Adhiraj Singh 6d02d405a7 Major redo with respect to chats/contacts -- read desc
Waiting for chats & contacts is hella unreliable, so I've put them as events
1. receive chats via the `chats-received` event. If new chats are found, the flag for that is sent as well
2. receive contacts via the `contacts-received` event
3. When WA sends older messages, the `chats-update` or `chat-update` event is triggered
4. Baileys keeps track of all the changed conversations between connects

Connects almost always take less than 10 seconds!
2020-11-13 23:15:16 +05:30