Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reload qrcode class #903

Open
wants to merge 561 commits into
base: API-Class
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
561 commits
Select commit Hold shift + click to select a range
224631d
NO_TICKET added docker-compose and entrypoint for docker
astami May 16, 2018
2a53132
Merge pull request #201 from gamba47/patch-1
mukulhase May 16, 2018
d28ae7f
Merge pull request #198 from sevetseh28/get_unread_fix
mukulhase May 16, 2018
11ad330
Merge pull request #203 from ninformations/master
mukulhase May 18, 2018
03295dd
Updated documentation + Misc. Code clean up
mukulhase May 18, 2018
a876701
Merge branch 'master' into patch-2
mukulhase May 18, 2018
650a1b8
Merge pull request #178 from bobaoapae/patch-2
mukulhase May 18, 2018
4a10a89
Merge remote-tracking branch 'origin/master'
mukulhase May 18, 2018
f840a32
Fixed a breaking line that was changed
houseme-brandon May 21, 2018
c8c7b4d
syntax and requirement changes
May 22, 2018
2597014
Merge pull request #214 from pranavvij/master
mukulhase May 24, 2018
c4a939f
window.Store Removed
bobaoapae May 25, 2018
9d41d52
update getUnreadMessagesInChat and getChatsModel
bobaoapae May 25, 2018
69acc8d
add getMsgsModel, getContactsModel
bobaoapae May 25, 2018
a64a254
add function to sendImage
bobaoapae May 26, 2018
8aa9573
Merge pull request #1 from bobaoapae/bobaoapae-patch-1
bobaoapae May 26, 2018
082c0f0
Merge pull request #220 from bobaoapae/patch-3
mukulhase May 26, 2018
81021ea
Merge branch 'master' into master
mukulhase May 26, 2018
056d631
Merge pull request #210 from Brandon2255p/master
mukulhase May 26, 2018
ae371fb
Merge pull request #6 from mukulhase/master
alfred82santa May 26, 2018
c4495f1
fixed bug in sendImageFromDatabasePicBot
bobaoapae May 26, 2018
0fe16a5
add function getChatByName
bobaoapae May 26, 2018
ec2ed27
Fixed Chat collection not available in some reasons
bobaoapae May 26, 2018
21549c7
Merge pull request #2 from bobaoapae/bobaoapae-patch-2
bobaoapae May 26, 2018
c42ad6a
fix collections undefined
bobaoapae May 26, 2018
60a6413
Merge pull request #223 from bobaoapae/patch-4
mukulhase May 27, 2018
3db47d6
Restore window.Store
bobaoapae May 28, 2018
bb3db98
restored Store.Wap
bobaoapae May 28, 2018
e3e88d2
Merge pull request #228 from bobaoapae/patch-5
mukulhase May 28, 2018
2c6b169
Merge from mukulhase/master
alfred82santa May 28, 2018
5a32a0b
Merge pull request #7 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
8e0f6bb
Fix
alfred82santa May 28, 2018
090f2c1
Merge pull request #8 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
ceda860
Fix
alfred82santa May 28, 2018
370fb9c
Merge pull request #9 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
6295acf
Fix
alfred82santa May 28, 2018
e351a3f
Merge pull request #10 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
a7be797
Fix
alfred82santa May 28, 2018
0832611
Merge pull request #11 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
c4211a3
Fix
alfred82santa May 28, 2018
1e2d99f
Merge pull request #12 from alfred82santa/merge/2018-05-28
alfred82santa May 28, 2018
e07eac6
Fixed merge
mukulhase May 28, 2018
fae0ec7
Add key for decrypting audio files
May 28, 2018
7b91104
Autodiscovery
alfred82santa May 28, 2018
570f0b6
Merge pull request #231 from alfred82santa/master
mukulhase May 28, 2018
5d144d3
Merge pull request #232 from drencrom/master
mukulhase May 28, 2018
c6e26b5
Update README.md
mukulhase May 29, 2018
f954dc7
Update README.md
mukulhase May 29, 2018
e251ab3
Update README.md
mukulhase May 29, 2018
76529ea
Update README.md
mukulhase May 29, 2018
87ee84b
credits
mukulhase May 29, 2018
efb33ec
Merge
mukulhase May 29, 2018
c444ff1
Update README.md
mukulhase May 29, 2018
2532feb
add function createGroup
bobaoapae May 29, 2018
d7f7890
Merge pull request #13 from alfred82santa/feature/autodiscovery
alfred82santa May 30, 2018
3795035
Merge from master
alfred82santa May 30, 2018
4bd477a
Merge pull request #14 from alfred82santa/merge/2018-05-30
alfred82santa May 30, 2018
3b3e83e
Merge from master
alfred82santa May 30, 2018
632e2bc
Merge from master
alfred82santa May 30, 2018
e9c11a2
Restore Store.Conn
bobaoapae May 30, 2018
fad2f58
Merge pull request #238 from bobaoapae/patch-6
mukulhase May 31, 2018
380ec6f
- Merging alfred82sant autodiscovery
brunosoaresds Jun 1, 2018
1962d9a
Adding new message event watcher
brunosoaresds Jun 1, 2018
c908e2b
Changing new message callback scheme.
brunosoaresds Jun 1, 2018
c931ed2
newMessagesCallback removal option after call
brunosoaresds Jun 1, 2018
919e5bb
Fixing bug on removable callback
brunosoaresds Jun 1, 2018
0454b30
Fixing DeleteChat function
brunosoaresds Jun 1, 2018
45ddb87
Create logo
Tobaloidee Jun 2, 2018
110d9be
uploaded the Logo files
Tobaloidee Jun 2, 2018
8fc1677
updated Readme with logo
Tobaloidee Jun 2, 2018
1d28e4d
Delete logo
Tobaloidee Jun 2, 2018
9df09cd
Merge pull request #256 from Tobaloidee/master
mukulhase Jun 2, 2018
0f427ce
Check and merge
mukulhase Jun 4, 2018
c673d69
Merge pull request #242 from alfred82santa/master
mukulhase Jun 4, 2018
1779856
Merge branch 'master' of git://github.com/mukulhase/WebWhatsapp-Wrapp…
brunosoaresds Jun 4, 2018
4d3b4a7
Merge branch 'mukulhase-master'
brunosoaresds Jun 4, 2018
5954f1f
- Added functions to check if the number that we would to send a mess…
brunosoaresds Jun 4, 2018
0de9fab
- Added the observable functions in python layer to get informed when…
brunosoaresds Jun 4, 2018
0003840
Removing Observable abstract class, checking only if the observer has…
brunosoaresds Jun 4, 2018
2f7461c
- Adding realoding treatment in new message observable
brunosoaresds Jun 4, 2018
cdcaf60
- Adding other list type check in new messages list return
brunosoaresds Jun 4, 2018
5dad030
- Fixing problem when calling checkNumberStatus function
brunosoaresds Jun 4, 2018
66d888d
Changing the observable function to works like a pooling because unfo…
brunosoaresds Jun 4, 2018
1c9d0d1
- Fixing length method in python and array listener definition
brunosoaresds Jun 4, 2018
760d177
Removing EventListener from webpack Store Object
brunosoaresds Jun 4, 2018
2c1602c
Merge pull request #261 from brunosoaresds/master
mukulhase Jun 5, 2018
04a97cc
Add example of new message observer
GeovRodri Jun 5, 2018
4f684bc
Reload wapi.js after reload page
GeovRodri Jun 5, 2018
a5b828a
Fix NumberStatus object creation
brunosoaresds Jun 7, 2018
cdc432d
Merge pull request #265 from GeovRodri/master
mukulhase Jun 8, 2018
2e064b9
Merge pull request #3 from mukulhase/master
brunosoaresds Jun 10, 2018
764b867
Adding session storage in the new messages buffer
brunosoaresds Jun 11, 2018
8cca18c
Merge pull request #280 from brunosoaresds/master
mukulhase Jun 11, 2018
fafad4b
Creating issue template
kevinkit Jun 12, 2018
271620a
Changing WapDelete module
brunosoaresds Jun 13, 2018
d4e475c
Complementing the latest commit.
brunosoaresds Jun 13, 2018
0e01c0f
Fix createGroup and chatDeletete bugs
brunosoaresds Jun 14, 2018
e6a1563
Merge pull request #286 from brunosoaresds/master
mukulhase Jun 15, 2018
5f22d19
Update contact.py
dafner Jun 16, 2018
ec92a46
Update message.py
dafner Jun 16, 2018
edcd7bb
Update wapi.js
dafner Jun 16, 2018
7024c00
Merge pull request #290 from dafner/master
mukulhase Jun 17, 2018
deeb790
Better hinting
kevinkit Jun 19, 2018
7aad5e7
implemented profile pic download, works for all ids even if not saved as
Jun 19, 2018
d0f0e8d
add function sendImage
bobaoapae Jun 22, 2018
f1e12b8
Free memory
bobaoapae Jun 22, 2018
2e2f492
implementation of the sendImage function
WilliamCampolina Jun 25, 2018
e8755c1
Merge pull request #3 from WilliamCampolina/patch-1
bobaoapae Jun 25, 2018
2e1297a
Fix Search for MediaCollection
bobaoapae Jun 27, 2018
d65ace7
Merge pull request #300 from bobaoapae/patch-7
mukulhase Jun 28, 2018
1ba97af
Merge pull request #297 from lukweb/master
mukulhase Jun 28, 2018
00efc7e
Send one or more contact cards to chat using the chat models ids
Jun 28, 2018
1574313
Update sendMessageWithThumb
bobaoapae Jun 28, 2018
1e655fe
add done parameter
bobaoapae Jun 28, 2018
114160a
add done parameter
bobaoapae Jun 28, 2018
97969d0
Merge pull request #311 from bobaoapae/patch-8
mukulhase Jun 28, 2018
4439d6a
Merge pull request #312 from samuelrbo/feature/js-send-contact-card
mukulhase Jun 28, 2018
6231187
Update requirements.txt to include python-magic
cesarandreslopez Jun 29, 2018
f800214
Adding function to send a simple VCARD or a VCARD list to a specific …
samuelrbo Jul 10, 2018
8535540
Merge pull request #315 from cesarandreslopez/patch-2
mukulhase Jul 11, 2018
3b98448
Merge pull request #325 from samuelrbo/develop
mukulhase Jul 11, 2018
3945cf2
Fix issue #316
anmay Jul 11, 2018
49659d2
update README.md for Windows
heinleit Jul 12, 2018
8b20841
Merge pull request #332 from heinleit/patch-1
mukulhase Jul 29, 2018
773f7e4
Merge pull request #330 from anmay/patch-1
mukulhase Jul 29, 2018
c512d62
Update README.md
heinleit Jul 29, 2018
92c3ea5
fix bug in get_all_chats
eliasaj92 Jul 31, 2018
858df76
Bugfix ModuleNotFoundError
Jul 31, 2018
086e7e6
Sorting
Aug 2, 2018
5836c80
Correcting the object copy that is used to the creation of the vCard …
Aug 7, 2018
b02eaea
Issue #334
Aug 10, 2018
93c8edb
Merge pull request #1 from mukulhase/master
GeovRodri Aug 16, 2018
20a1dfe
Create get_qr_base64 to return in base64 so as not to waste processin…
GeovRodri Aug 16, 2018
79e3a79
returning screenshot_as_base64
GeovRodri Aug 16, 2018
f75bffc
Adjustment in reload qr code
GeovRodri Aug 17, 2018
f9e9684
Create send_media.py
lfdelphino Aug 19, 2018
c6eaaa1
Checking in store conn if logged in
GeovRodri Aug 20, 2018
5f40570
return old method is logged in
GeovRodri Aug 20, 2018
307cf1a
Update README.md
lfdelphino Aug 21, 2018
16200c2
Merge pull request #349 from eliasaj92/master
mukulhase Aug 21, 2018
fa43800
Merge pull request #355 from leandroreis/master
mukulhase Aug 21, 2018
c393918
Merge pull request #358 from samuelrbo/master
mukulhase Aug 21, 2018
2d86875
Merge pull request #367 from GeovRodri/master
mukulhase Aug 21, 2018
839d4f1
Merge pull request #372 from lfdelphino/patch-1
mukulhase Aug 21, 2018
f891c57
Merge pull request #374 from lfdelphino/patch-2
mukulhase Aug 21, 2018
eb12ec9
Merge pull request #347 from heinleit/patch-2
mukulhase Aug 21, 2018
617e607
Merge pull request #2 from mukulhase/master
GeovRodri Aug 22, 2018
42203dd
Improving login checking
GeovRodri Aug 22, 2018
cba64a1
add send_media
eduardomazolini Aug 23, 2018
1f70acd
getAllChatIds - Return _serializable or chat id, sometimes the id was…
GeovRodri Aug 24, 2018
a8923ae
Merge pull request #377 from GeovRodri/master
mukulhase Aug 24, 2018
d05945e
Fixed a bug in new version of chat id
GeovRodri Aug 24, 2018
7d9cec8
Fixed a bug in getChat
GeovRodri Aug 24, 2018
e86450c
Alter get id in whatsapp object
GeovRodri Aug 24, 2018
a3d8004
Merge pull request #378 from eduardomazolini/patch-1
mukulhase Aug 31, 2018
9e54883
Merge pull request #380 from GeovRodri/master
mukulhase Aug 31, 2018
92dfd80
Update wapi.js
eduardomazolini Sep 3, 2018
16e1c0a
Update wapi.js
eduardomazolini Sep 3, 2018
bd3585c
Adjustment in send message to create new chat instead of using the fi…
GeovRodri Sep 3, 2018
4b55040
Refactoring in function send message to id
GeovRodri Sep 4, 2018
9d5ddef
Merge pull request #3 from mukulhase/master
GeovRodri Sep 4, 2018
c52a22f
Fixed checkNumberStatus for NoneType
lfdelphino Sep 4, 2018
49d3663
Fixed checkNumberStatus for NoneType
lfdelphino Sep 4, 2018
4741ed5
Merge branch 'master' into master
lfdelphino Sep 4, 2018
27bd616
Changed deleteConversation function to use chat object sendDelete. Th…
GeovRodri Sep 5, 2018
15c5b3c
Merge remote-tracking branch 'origin/master'
GeovRodri Sep 5, 2018
8c23588
Merge pull request #398 from GeovRodri/master
mukulhase Sep 6, 2018
af1d07c
Merge pull request #400 from lfdelphino/master
mukulhase Sep 6, 2018
5eb0491
Merge branch 'master' into patch-1
mukulhase Sep 6, 2018
a904132
Fixed sorting of unread messages (now by timestamp)
sevetseh28 Sep 7, 2018
67ef92e
Merge pull request #405 from sevetseh28/fix-unreadmsgs-sorting
mukulhase Sep 8, 2018
43ac856
Merge pull request #402 from eduardomazolini/patch-1
mukulhase Sep 8, 2018
0ff4b76
MediaMessage caption default empty
eduardomazolini Sep 8, 2018
f226b99
Rename dockerfile to Dockerfile
cantecim Sep 9, 2018
2097832
Save session cookies to read QR code only once
eduardomazolini Sep 9, 2018
04df445
Update remote.py
eduardomazolini Sep 9, 2018
ceb2baf
Add files via upload
dafner Sep 12, 2018
bdc445e
Merge pull request #410 from eduardomazolini/patch-1
mukulhase Sep 12, 2018
0e7be99
Merge pull request #409 from eduardomazolini/eduardomazolini-patch-1
mukulhase Sep 12, 2018
796efb0
Merge pull request #408 from cantecim/master
mukulhase Sep 12, 2018
13c1cd8
Update contact.py
dafner Sep 12, 2018
03caa2c
Update README.md
mukulhase Sep 13, 2018
491cc1a
block/unblock contact
pabloruan0710 Sep 13, 2018
582f4b1
add function remove participant group
pabloruan0710 Sep 13, 2018
8491aff
add functions for python
pabloruan0710 Sep 13, 2018
b6268cd
Merge pull request #421 from pabloruan0710/featured_contact
mukulhase Sep 13, 2018
1af6ae3
promote/demote participant admin group
pabloruan0710 Sep 14, 2018
8e06eb3
Updated Pipfile with current requirements
rbnishant Sep 15, 2018
9824a62
Improvements
rbnishant Sep 16, 2018
b97df17
Merge pull request #426 from rbnishant/master
mukulhase Sep 16, 2018
67e022e
Fix to getProfilePics
lfdelphino Sep 16, 2018
dce8ea7
Update to get_profile_pics
lfdelphino Sep 16, 2018
f2ecbfe
Update wapi.js
lfdelphino Sep 18, 2018
6b7083f
Fix to sendImage
lfdelphino Sep 18, 2018
bb6d07e
Bug Fix
rbnishant Sep 19, 2018
32fcede
corrected chrome_cache path in flask sample
rbnishant Sep 19, 2018
ff6f4cf
added function leaveGroup
rbnishant Sep 19, 2018
3ab6c7a
updated leaveGroup function
rbnishant Sep 19, 2018
06060f6
Merge pull request #423 from pabloruan0710/featured-group
mukulhase Sep 20, 2018
377edb3
Merge branch 'master' into master
lfdelphino Sep 20, 2018
b499b4e
Merge branch 'master' into patch-1
lfdelphino Sep 20, 2018
a2c7e20
fixed how to identify geo messages correctly
Sep 20, 2018
6233a91
keeping both types of GeoMessage validation
Sep 20, 2018
9161d3a
Bug Fixed group_get_participants id
Theblood Sep 21, 2018
a0fb118
Merge pull request #454 from Theblood/patch-2
mukulhase Sep 22, 2018
31ecc0c
Merge pull request #446 from rbnishant/groupsendexit
mukulhase Sep 22, 2018
75ab0d9
Merge pull request #430 from lfdelphino/master
mukulhase Sep 22, 2018
2ec50cb
Merge pull request #441 from lfdelphino/patch-1
mukulhase Sep 22, 2018
629df14
Merge pull request #419 from dafner/master
mukulhase Sep 22, 2018
c579c97
Merge pull request #444 from rbnishant/master
mukulhase Sep 22, 2018
64329b9
Added hint to advertisment
kevinkit Sep 22, 2018
f34b901
Update README.md
mukulhase Oct 1, 2018
dda895c
Fixed isue on chat.get_messages() as listed by the following issues:
houseme-brandon Oct 2, 2018
acbc425
Merge pull request #472 from Brandon2255p/master
mukulhase Oct 2, 2018
946d072
Merge pull request #450 from nilsenmiotto/master
mukulhase Oct 16, 2018
91a793b
sendVCard displayName as subtype and undefined Conn fix
choval Oct 18, 2018
a5f4c2f
Merge pull request #483 from choval/patch-1
mukulhase Oct 23, 2018
99f75ec
Delete Messages (#587)
lfdelphino Mar 27, 2019
2081d0b
update README (#524)
acarist Mar 27, 2019
1bc0b1a
Workaround for "Cyclic object value" error by pinning the standalone-…
croesnick Mar 27, 2019
d5280ca
Fixed contact throwing 'not defined' errors (#536)
tgodoib Apr 15, 2019
81b918e
FIX: finish running thread that checks new messages when WhatsAPIDriv…
lfagundes Apr 28, 2019
360e380
Fix wrong identation (last commit broke tests, code don't even compil…
lfagundes May 12, 2019
e1f08b4
A simple logger of everything (#603)
AldoErco May 12, 2019
5a16726
Add executable_path arg in __init__.py (#614)
renatonerijr May 12, 2019
c9f1792
Update wapi.js (#644)
kaykyr May 30, 2019
84be49b
Update wapi.js MORE BUG FIXES AND IMPROMENTS (#653)
kaykyr Jun 9, 2019
27743bb
Change qr div selector (#697)
mrodal Aug 25, 2019
2b8c738
New Function: isConnected (#701)
kaykyr Aug 28, 2019
7367df6
Fix for issue #545 and #684 (#707)
Arlington1985 Sep 14, 2019
da1dd39
Update wapi.js (#713)
kaykyr Sep 25, 2019
75cbc99
Fix wapi.js injection (#731)
kaykyr Oct 11, 2019
26ea13a
Corrected mistype (#728)
VictorGaiva Oct 21, 2019
21e9147
Feature/improvement (#763)
marcelomaia Nov 28, 2019
0e65b7e
Fix Missing ChatClass (#768)
marcelomaia Dec 11, 2019
9928818
Update to wapi.js resolves #776 (#777)
smashah Dec 11, 2019
020fac9
Feature/get chat by name (#775)
marcelomaia Dec 11, 2019
78d4114
Fix webpackJsonp error
Mar 27, 2020
8798eaf
Merge pull request #861 from felippeefreire/master
dev-bitrix Apr 25, 2020
7abcdce
All working well, super pull request! (#880)
marcelomaia May 21, 2020
5e30eb3
Fix error on load modules (#888)
felippeefreire Aug 10, 2020
e468b1c
copy requirements into container (#919)
salarnasiri Aug 10, 2020
30d2500
Update setup.py (#882)
yogasw Aug 10, 2020
63f6f94
Fixing selenium.common.exceptions.TimeoutException: Message: (#936)
Basit-qc Sep 28, 2020
882ca25
Fixes some problems (#929)
andreguilhon Sep 28, 2020
0597f66
Add async check_number_status to WhatsAPIDriverAsync (#950)
GuerreiroLeonardo Oct 19, 2020
d05279e
Update wapi.js (#946)
OfirKP Oct 19, 2020
44d4305
Update Wapi.js Fix Issue: #1002 (#1003)
bobaoapae Feb 26, 2021
1246494
user defined executable_path for chrome driver added (#1022)
sisodiakaran Jul 24, 2021
d2ea6e8
add str chatid in get_all_messages_in_chat (#992)
santirlopez1124 Jul 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions webwhatsapi/js/wapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,31 @@ window.WAPI._serializeMessageObj = (obj) => {
* @returns {Array|*} List of contacts
*/

const chatCollection = document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.memoizedState.chats[0].collection;
const msgCollection = document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.memoizedState.chats[0].msgs.models[0].collection;
const contactCollection = document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.child.child.child.child.memoizedState.chats[0].contact.collection;

if (window.Store === undefined) {
webpackJsonp([], {"bcihgfbdeb": (x, y, z) => window.Store = z('"bcihgfbdeb"')}, "bcihgfbdeb");
webpackJsonp([], {"iaeeehaci": (x, y, z) => window.Store.Wap = z('"iaeeehaci"')}, "iaeeehaci");
}


window.WAPI.getConnectionInfo = function (done) {
if (done !== undefined) {
done(document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.memoizedProps.children[5].props.conn);
done(Store.Conn);
} else {
return document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.memoizedProps.children[5].props.conn;
return Store.Conn;
}
};

window.WAPI.getChatsModel = function (done) {
if (done !== undefined) {
if (chatCollection !== undefined) {
done(chatCollection.models);
if (Store.Chat !== undefined) {
done(Store.Chat.models);
} else {
done([]);
}
} else {
if (chatCollection !== undefined) {
return (chatCollection.models);
if (Store.Chat !== undefined) {
return (Store.Chat.models);
} else {
return ([]);
}
Expand All @@ -119,14 +120,14 @@ window.WAPI.getChatsModel = function (done) {

window.WAPI.getContactsModel = function (done) {
if (done !== undefined) {
if (contactCollection !== undefined) {
done(contactCollection.models);
if (Store.Contact !== undefined) {
done(Store.Contact.models);
} else {
done([]);
}
} else {
if (contactCollection !== undefined) {
return (contactCollection.models);
if (Store.Contact !== undefined) {
return (Store.Contact.models);
} else {
return ([]);
}
Expand All @@ -135,14 +136,14 @@ window.WAPI.getContactsModel = function (done) {

window.WAPI.getMsgsModel = function (done) {
if (done !== undefined) {
if (msgCollection !== undefined) {
done(msgCollection.models);
if (Store.Msg !== undefined) {
done(Store.Msg.models);
} else {
done([]);
}
} else {
if (msgCollection !== undefined) {
return (msgCollection.models);
if (Store.Msg !== undefined) {
return (Store.Msg.models);
} else {
return ([]);
}
Expand Down Expand Up @@ -305,6 +306,24 @@ window.WAPI.sendImageFromDatabasePicBot = function (picId, chatId, caption) {
return true;
};

window.WAPI.sendMessageWithThumb = function (thumb, url, title, description, chatId) {
var chatSend = WAPI.getChat(chatId);
if (chatSend === undefined) {
return false;
}
var msgWithImg = chatSend.createMessageFromText(".");
msgWithImg.__x_hasLink = title;
msgWithImg.__x_body = description + '\n ' + url;
msgWithImg.__x_isLink = title;
msgWithImg.__x_description = description;
msgWithImg.__x_subtype = 'url';
msgWithImg.__x_title = title;
msgWithImg.__x_thumbnail = thumb;
return chatSend.addAndSendMsg(msgWithImg);

return true;
};

window.WAPI.getNewId = function () {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Expand Down