Skip to content

Commit

Permalink
fix: Fixed getStatus function (fix #804)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jan 20, 2022
1 parent 037000d commit f02988c
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 55 deletions.
2 changes: 1 addition & 1 deletion src/api/layers/profile.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class ProfileLayer extends HostLayer {
return await evaluateAndReturn(
this.page,
({ status }) => {
WAPI.setMyStatus(status);
WPP.profile.setMyStatus(status);
},
{ status }
);
Expand Down
2 changes: 1 addition & 1 deletion src/api/layers/retriever.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class RetrieverLayer extends SenderLayer {
public async getStatus(contactId: string) {
return evaluateAndReturn(
this.page,
(contactId) => WAPI.getStatus(contactId),
(contactId) => WPP.contact.getStatus(contactId),
contactId
);
}
Expand Down
20 changes: 0 additions & 20 deletions src/lib/wapi/functions/get-status.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/lib/wapi/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export { getMe } from './get-me';
export { getMyContacts } from './get-my-contacts';
export { getNewId } from './get-new-id';
export { getNumberProfile } from './get-number-profile';
export { getStatus } from './get-status';
export { getUnreadMessages } from './get-unread-messages';
export { getUnreadMessagesInChat } from './get-unread-messages-in-chat';
export { hasUndreadMessages } from './has-unread-messages';
Expand Down Expand Up @@ -78,7 +77,6 @@ export { sendMessage2 } from './send-message2';
export { sendSticker } from './send-sticker';
export { sendVideoAsGif } from './send-video-as-gif';
export { setMyName } from './set-my-name';
export { setMyStatus } from './set-my-status';
export { forwardMessages } from './forward-messages';
export { getMessageById } from './get-message-by-id';
export { getMessages } from './get-messages';
Expand Down
20 changes: 0 additions & 20 deletions src/lib/wapi/functions/set-my-status.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/lib/wapi/store/store-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ export const storeObjects = [
conditions: (module) =>
module.queryIdentity && module.updateIdentity ? module : null,
},
{
id: 'MyStatus',
conditions: (module) =>
module.getStatus && module.setMyStatus ? module : null,
},
{
id: 'ChatStates',
conditions: (module) =>
Expand Down
4 changes: 0 additions & 4 deletions src/lib/wapi/wapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {
getMyContacts,
getNewId,
getNumberProfile,
getStatus,
getUnreadMessages,
getUnreadMessagesInChat,
hasUndreadMessages,
Expand Down Expand Up @@ -78,7 +77,6 @@ import {
sendSticker,
sendVideoAsGif,
setMyName,
setMyStatus,
openChat,
openChatAt,
getGroupInfoFromInviteLink,
Expand Down Expand Up @@ -215,7 +213,6 @@ if (typeof window.WAPI === 'undefined') {
window.WAPI.sendPtt = sendPtt;
window.WAPI.sendFile = sendFile;
window.WAPI.setMyName = setMyName;
window.WAPI.setMyStatus = setMyStatus;
window.WAPI.sendVideoAsGif = sendVideoAsGif;
window.WAPI.processFiles = processFiles;
window.WAPI.sendImageWithProduct = sendImageWithProduct;
Expand Down Expand Up @@ -245,7 +242,6 @@ if (typeof window.WAPI === 'undefined') {
window.WAPI.getAllChatsWithMessages = getAllChatsWithMessages;
window.WAPI.getAllGroups = getAllGroups;
window.WAPI.getChat = getChat;
window.WAPI.getStatus = getStatus;
window.WAPI.getChatByName = getChatByName;
window.WAPI.getNewId = getNewId;
window.WAPI.getChatById = getChatById;
Expand Down
2 changes: 0 additions & 2 deletions src/types/WAPI.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ interface WAPI {
getMessages: (chatId: string, params: GetMessagesParam) => Promise<Message[]>;
getNumberProfile: (contactId: string) => WhatsappProfile;
getSessionTokenBrowser: (removePath?: boolean) => SessionToken;
getStatus: (contactId: string) => ContactStatus;
getTheme: () => string;
getUnreadMessages: (
includeMe: boolean,
Expand Down Expand Up @@ -205,7 +204,6 @@ interface WAPI {
setGroupSubject: (groupId: string, title: string) => Promise<object>;
setMessagesAdminsOnly: (chatId: string, option: boolean) => boolean;
setMyName: (name: string) => void;
setMyStatus: (to: string) => void;
setOnlinePresence: (online: boolean) => void;
setProfilePic: (path: string, to?: string) => Promise<boolean>;
setTemporaryMessages: (chatId: string, value: string) => Promise<boolean>;
Expand Down

0 comments on commit f02988c

Please sign in to comment.