Skip to content

Commit

Permalink
fix: Fixed more functions to Whatsapp >= 2.3000.1015281091
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 31, 2024
1 parent 6319d34 commit abff8fe
Show file tree
Hide file tree
Showing 19 changed files with 148 additions and 32 deletions.
1 change: 1 addition & 0 deletions src/webpack/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export function search<T = any>(
condition: SearchModuleCondition,
reverse = false
): T | null {
console.log(condition);
const moduleId = searchId(condition, reverse);

if (!moduleId) {
Expand Down
7 changes: 5 additions & 2 deletions src/whatsapp/collections/BusinessProfileCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export declare class BusinessProfileCollection extends Collection<BusinessProfil
exportModule(
exports,
{
BusinessProfileCollection: 'BusinessProfileCollectionImpl',
BusinessProfileCollection: [
'BusinessProfileCollectionImpl',
'BusinessProfileCollection',
],
},
(m) => m.BusinessProfileCollectionImpl
(m) => m.BusinessProfileCollectionImpl || m.BusinessProfileCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/CartCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export declare class CartCollection extends Collection<CartModel> {
}
exportModule(
exports,
{ CartCollection: 'CartCollectionImpl' },
(m) => m.CartCollectionImpl
{ CartCollection: ['CartCollectionImpl', 'CartCollection'] },
(m) => m.CartCollectionImpl || m.CartCollection
);
2 changes: 1 addition & 1 deletion src/whatsapp/collections/CatalogCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ export declare class CatalogCollection extends Collection<CatalogModel> {
}
exportModule(
exports,
{ CatalogCollection: 'CatalogCollectionImpl' },
{ CatalogCollection: ['CatalogCollectionImpl', 'CatalogCollection'] },
(m) => m.CatalogCollectionImpl || m.CatalogCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/ChatstateCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export declare class ChatstateCollection extends Collection<ChatstateModel> {
exportModule(
exports,
{
ChatstateCollection: ['ChatstateCollectionImpl', 'ChatstateCollection'],
ChatstateCollection: ['ChatstateCollectionImpl', 'Chatstate'],
},
(m) => m.ChatstateCollectionImpl || m.ChatstateCollection
(m) => m.ChatstateCollectionImpl || m.Chatstate
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/EmojiVariantCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export declare class EmojiVariantCollection extends Collection<EmojiVariantModel
exportModule(
exports,
{
EmojiVariantCollection: 'EmojiVariantCollectionImpl',
EmojiVariantCollection: [
'EmojiVariantCollectionImpl',
'EmojiVariantCollection',
],
},
(m) => m.EmojiVariantCollectionImpl
(m) => m.EmojiVariantCollectionImpl || m.EmojiVariantCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/LabelCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ export declare class LabelCollection extends BaseCollection<LabelModel> {
}
exportModule(
exports,
{ LabelCollection: 'LabelCollectionImpl' },
(m) => m.LabelCollectionImpl
{ LabelCollection: ['LabelCollectionImpl', 'LabelCollection'] },
(m) => m.LabelCollectionImpl || m.LabelCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/MsgInfoCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ export declare class MsgInfoCollection extends BaseCollection<MsgInfoModel> {
}
exportModule(
exports,
{ MsgInfoCollection: 'MsgInfoCollectionImpl' },
(m) => m.MsgInfoCollectionImpl
{ MsgInfoCollection: ['MsgInfoCollectionImpl', 'MsgInfoCollection'] },
(m) => m.MsgInfoCollectionImpl || m.MsgInfoCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/MuteCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ export declare class MuteCollection extends Collection<MuteModel> {
}
exportModule(
exports,
{ MuteCollection: 'MuteCollectionImpl' },
(m) => m.MuteCollectionImpl
{ MuteCollection: ['MuteCollectionImpl', 'MuteCollection'] },
(m) => m.MuteCollectionImpl || m.MuteCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/OrderCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export declare class OrderCollection extends Collection<OrderModel> {
}
exportModule(
exports,
{ OrderCollection: 'OrderCollectionImpl' },
(m) => m.OrderCollectionImpl
{ OrderCollection: ['OrderCollectionImpl', 'OrderCollection'] },
(m) => m.OrderCollectionImpl || m.OrderCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/PinInChatCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ export declare class PinInChatCollection extends Collection<PinInChatModel> {
}
exportModule(
exports,
{ PinInChatCollection: 'PinInChatCollectionImpl' },
(m) => m.PinInChatCollectionImpl
{ PinInChatCollection: ['PinInChatCollectionImpl', 'PinInChatCollection'] },
(m) => m.PinInChatCollectionImpl || m.PinInChatCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/ProductMessageListCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export declare class ProductMessageListCollection extends Collection<ProductMess
exportModule(
exports,
{
ProductMessageListCollection: 'ProductMessageListCollectionImpl',
ProductMessageListCollection: [
'ProductMessageListCollectionImpl',
'ProductMessageListCollection',
],
},
(m) => m.ProductMessageListCollectionImpl
(m) => m.ProductMessageListCollectionImpl || m.ProductMessageListCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/RecentEmojiCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export declare class RecentEmojiCollection extends Collection<RecentEmojiModel>
exportModule(
exports,
{
RecentEmojiCollection: 'RecentEmojiCollectionImpl',
RecentEmojiCollection: [
'RecentEmojiCollectionImpl',
'RecentEmojiCollection',
],
},
(m) => m.RecentEmojiCollectionImpl
(m) => m.RecentEmojiCollectionImpl || m.RecentEmojiCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/RecentStickerCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export declare class RecentStickerCollection extends Collection<StickerModel> {
exportModule(
exports,
{
RecentStickerCollection: 'RecentStickerCollectionImpl',
RecentStickerCollection: [
'RecentStickerCollectionImpl',
'RecentStickerCollection',
],
},
(m) => m.RecentStickerCollectionImpl
(m) => m.RecentStickerCollectionImpl || m.RecentStickerCollection
);
4 changes: 2 additions & 2 deletions src/whatsapp/collections/StatusCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export declare class StatusCollection extends BaseCollection<StatusModel> {
exportModule(
exports,
{
StatusCollection: 'TextStatusCollectionImpl',
StatusCollection: ['TextStatusCollectionImpl', 'TextStatusCollection'],
},
(m) => m.TextStatusCollectionImpl
(m) => m.TextStatusCollectionImpl || m.TextStatusCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/StickerPackCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export declare class StickerPackCollection extends Collection<StickerPackModel>
exportModule(
exports,
{
StickerPackCollection: 'StickerPackCollectionImpl',
StickerPackCollection: [
'StickerPackCollectionImpl',
'StickerPackCollection',
],
},
(m) => m.StickerPackCollectionImpl
(m) => m.StickerPackCollectionImpl || m.StickerPackCollection
);
7 changes: 5 additions & 2 deletions src/whatsapp/collections/StickerSearchCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export declare class StickerSearchCollection extends Collection<StickerModel> {
exportModule(
exports,
{
StickerSearchCollection: 'StickerSearchCollectionImpl',
StickerSearchCollection: [
'StickerSearchCollectionImpl',
'StickerSearchCollection',
],
},
(m) => m.StickerSearchCollectionImpl
(m) => m.StickerSearchCollectionImpl || m.StickerSearchCollection
);
2 changes: 1 addition & 1 deletion src/whatsapp/models/PresenceModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ exportModule(
{
PresenceModel: 'Presence',
},
(m) => m.Presence && m.ChatstateCollection
(m) => (m.Presence && m.ChatstateCollection) || (m.Presence && m.Chatstate)
);
94 changes: 94 additions & 0 deletions src/whatsapp/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,97 @@ exportModule(
},
(m) => m.PresenceCollectionImpl || m.PresenceCollection
);

exportModule(
exports,
{
CartStore: ['CartCollectionImpl', 'CartCollection'],
},
(m) => m.CartCollectionImpl || m.CartCollection
);

exportModule(
exports,
{
CatalogStore: ['CatalogCollectionImpl', 'CatalogCollection'],
},
(m) => m.CatalogCollectionImpl || m.CatalogCollection
);

exportModule(
exports,
{
EmojiVariantStore: ['EmojiVariantCollectionImpl', 'EmojiVariantCollection'],
},
(m) => m.EmojiVariantCollectionImpl || m.EmojiVariantCollection
);

exportModule(
exports,
{
LabelStore: ['LabelCollectionImpl', 'LabelCollection'],
},
(m) => m.LabelCollectionImpl || m.LabelCollection
);

exportModule(
exports,
{
MsgInfoStore: ['MsgInfoCollectionImpl', 'MsgInfoCollection'],
},
(m) => m.MsgInfoCollectionImpl || m.MsgInfoCollection
);

exportModule(
exports,
{
MuteStore: ['MuteCollectionImpl', 'MuteCollection'],
},
(m) => m.MuteCollectionImpl || m.MuteCollection
);

exportModule(
exports,
{
OrderStore: ['OrderCollectionImpl', 'OrderCollection'],
},
(m) => m.OrderCollectionImpl || m.OrderCollection
);

exportModule(
exports,
{
PinInChatStore: ['PinInChatCollectionImpl', 'PinInChatCollection'],
},
(m) => m.PinInChatCollectionImpl || m.PinInChatCollection
);

exportModule(
exports,
{
ProductMessageListStore: [
'ProductMessageListCollectionImpl',
'ProductMessageListCollection',
],
},
(m) => m.ProductMessageListCollectionImpl || m.ProductMessageListCollection
);

exportModule(
exports,
{
RecentEmojiStore: ['RecentEmojiCollectionImpl', 'RecentEmojiCollection'],
},
(m) => m.RecentEmojiCollectionImpl || m.RecentEmojiCollection
);

exportModule(
exports,
{
StickerSearchStore: [
'StickerSearchCollectionImpl',
'StickerSearchCollection',
],
},
(m) => m.StickerSearchCollectionImpl || m.StickerSearchCollection
);

0 comments on commit abff8fe

Please sign in to comment.