Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix: profilePictureUrl (WhiskeySockets#901)

* Update module to latest version  (WhiskeySockets#926)

* Update package.json

Update the module to the latest

* Add files via upload

* Fix: Readme use upsert events (WhiskeySockets#908)

* Fix: getUSyncDevices (WhiskeySockets#862)

* Update messages-send.ts

* Update messages-send.ts

* Update messages-send.ts

* Fix lint

* Fix lint

* fix(master): update linting workflow to node 20 (current LTS)

---------

Co-authored-by: Akhlaqul Muhammad Fadwa <75623219+zennn08@users.noreply.github.com>
Co-authored-by: Rizz2Dev <muhamad.rizki27483@smp.belajar.id>
Co-authored-by: Oscar Guindzberg <oscar.guindzberg@gmail.com>
Co-authored-by: Bob <115008575+bobslavtriev@users.noreply.github.com>
  • Loading branch information
5 people authored Jul 27, 2024
1 parent f330c94 commit 2e65f3f
Show file tree
Hide file tree
Showing 6 changed files with 2,214 additions and 2,991 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v1
with:
node-version: 18.x
node-version: 20.x

- name: Install packages
run: yarn
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ const sock = makeWASocket({ })
// the store can listen from a new socket once the current socket outlives its lifetime
store.bind(sock.ev)
sock.ev.on('chats.set', () => {
sock.ev.on('chats.upsert', () => {
// can use "store.chats" however you want, even after the socket dies out
// "chats" => a KeyedDB instance
console.log('got chats', store.chats.all())
})
sock.ev.on('contacts.set', () => {
sock.ev.on('contacts.upsert', () => {
console.log('got contacts', Object.values(store.contacts))
})
Expand Down
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,43 +44,43 @@
},
"dependencies": {
"@adiwajshing/keyed-db": "^0.2.4",
"@hapi/boom": "^9.1.3",
"@hapi/boom": "^10.0.1",
"async-lock": "^1.4.1",
"audio-decode": "^2.1.3",
"axios": "^1.6.0",
"cache-manager": "4.0.1",
"futoin-hkdf": "^1.5.1",
"libphonenumber-js": "^1.10.20",
"audio-decode": "^2.2.0",
"axios": "^1.7.2",
"cache-manager": "5.7.2",
"futoin-hkdf": "^1.5.3",
"libphonenumber-js": "^1.11.4",
"libsignal": "github:WhiskeySockets/libsignal-node",
"lodash": "^4.17.21",
"music-metadata": "^7.12.3",
"music-metadata": "^9.0.1",
"node-cache": "^5.1.2",
"pino": "^7.0.0",
"protobufjs": "^7.2.4",
"pino": "^9.3.0",
"protobufjs": "^7.3.2",
"uuid": "^10.0.0",
"ws": "^8.13.0"
"ws": "^8.18.0"
},
"devDependencies": {
"@adiwajshing/eslint-config": "github:adiwajshing/eslint-config",
"@types/got": "^9.6.11",
"@types/jest": "^27.5.1",
"@types/node": "^16.0.0",
"@types/sharp": "^0.29.4",
"@types/ws": "^8.0.0",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.0.0",
"jest": "^27.0.6",
"jimp": "^0.16.1",
"@types/got": "^9.6.12",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.10",
"@types/sharp": "^0.31.1",
"@types/ws": "^8.5.11",
"conventional-changelog-cli": "^5.0.0",
"eslint": "^9.7.0",
"jest": "^29.7.0",
"jimp": "^0.22.12",
"json": "^11.0.0",
"link-preview-js": "^3.0.0",
"open": "^8.4.2",
"link-preview-js": "^3.0.5",
"open": "^10.1.0",
"qrcode-terminal": "^0.12.0",
"release-it": "^15.10.3",
"sharp": "^0.32.6",
"ts-jest": "^27.0.3",
"ts-node": "^10.8.1",
"typedoc": "^0.24.7",
"typescript": "^4.6.4"
"release-it": "^17.6.0",
"sharp": "^0.33.4",
"ts-jest": "^29.2.2",
"ts-node": "^10.9.2",
"typedoc": "^0.26.4",
"typescript": "^5.5.3"
},
"peerDependencies": {
"jimp": "^0.16.1",
Expand Down
3 changes: 2 additions & 1 deletion src/Socket/chats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ export const makeChatsSocket = (config: SocketConfig) => {
const result = await query({
tag: 'iq',
attrs: {
to: jid,
target: jid,
to: S_WHATSAPP_NET,
type: 'get',
xmlns: 'w:profile:picture'
},
Expand Down
4 changes: 4 additions & 0 deletions src/Socket/messages-send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ export const makeMessagesSocket = (config: SocketConfig) => {
}
}

if(!users.length) {
return deviceResults
}

const iq: BinaryNode = {
tag: 'iq',
attrs: {
Expand Down
Loading

0 comments on commit 2e65f3f

Please sign in to comment.