@wppconnect/wa-js 2.14.0 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
- # 2.14.0 (2022-10-30)
1
+ ## 2.14.1 (2022-11-01)
2
2
 
3
- ### Features
3
+ ### Bug Fixes
4
4
 
5
- - Added WPP.conn.isRegistered function ([44c4664](https://github.com/wppconnect-team/wa-js/commit/44c46649047464c230565ca143418e72417bea99))
5
+ - Fixed WPP.chat.starMessage function (fix [#729](https://github.com/wppconnect-team/wa-js/issues/729)) ([bfa6969](https://github.com/wppconnect-team/wa-js/commit/bfa69697e8adbc8e2da82b4a9984d46daf01d79f))
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { MsgKey, MsgLoad } from '../misc';
17
+ import { ChatModel, MsgModel } from '../models';
18
+ /**
19
+ * @whatsapp 738599 >= 2.2242.5
20
+ */
21
+ export declare function getSearchContext(chat: ChatModel, msg: MsgModel | MsgKey, options?: {
22
+ isQuotedMsgAvailable: boolean;
23
+ }): {
24
+ collection: MsgLoad;
25
+ msg?: MsgModel;
26
+ key?: MsgKey;
27
+ highlightMsg: true;
28
+ };
@@ -32,6 +32,7 @@ export * from './genMinimalLinkPreview';
32
32
  export * from './getFanOutList';
33
33
  export * from './getGroupSenderKeyList';
34
34
  export * from './getOrGenerate';
35
+ export * from './getSearchContext';
35
36
  export * from './groupParticipants';
36
37
  export * from './handleAck';
37
38
  export * from './isAuthenticated';
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ChatModel } from '..';
17
+ import { getSearchContext } from '../functions';
17
18
  import { MsgModel } from '../models';
18
19
  import { EventEmitter } from '.';
19
20
  /** @whatsapp 88102
@@ -49,15 +50,15 @@ export declare class CmdClass extends EventEmitter {
49
50
  openMediaViewerForAlbumMedia(e?: any): void;
50
51
  productImageViewerModal(e?: any, t?: any): void;
51
52
  ephemeralDrawer(e?: any, t?: any): void;
52
- sendStarMsgs(e?: any, t?: any, r?: any, n?: any): void;
53
- sendUnstarMsgs(e?: any, t?: any, r?: any, n?: any): void;
53
+ sendStarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
54
+ sendUnstarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
54
55
  sendDeleteMsgs(chat: ChatModel, msgs: MsgModel[], clearMedia?: boolean, toastPosition?: any): void;
55
56
  sendRevokeMsgs(chat: ChatModel, msgs: MsgModel[], options?: {
56
57
  clearMedia?: boolean;
57
58
  toastPosition?: any;
58
59
  }): void;
59
60
  _openChat(e?: any, t?: any): void;
60
- openChatAt(chat: ChatModel, context: ReturnType<ChatModel['getSearchContext']>): Promise<boolean>;
61
+ openChatAt(chat: ChatModel, context: ReturnType<typeof getSearchContext>): Promise<boolean>;
61
62
  openChatFromUnread(chat: ChatModel): Promise<boolean>;
62
63
  openChatBottom(chat: ChatModel): Promise<boolean>;
63
64
  scrollToPtt(e?: any): void;
@@ -131,7 +131,7 @@ export declare class ChatModel extends ModelChatBase {
131
131
  loadEarlierMsgs(e?: any, t?: any): any;
132
132
  isMostRecentCMC(e?: any): boolean;
133
133
  loadRecentMsgs(e?: any): any;
134
- getSearchContext(msg: MsgModel | MsgKey, options?: {
134
+ getSearchContext?(msg: MsgModel | MsgKey, options?: {
135
135
  isQuotedMsgAvailable: boolean;
136
136
  }): {
137
137
  collection: MsgLoad;
@@ -139,7 +139,6 @@ export declare class ChatModel extends ModelChatBase {
139
139
  key?: MsgKey;
140
140
  highlightMsg: true;
141
141
  };
142
- sendStarMsgs(msgs: MsgModel[], star: boolean): any;
143
142
  sendRevokeMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
144
143
  sendRevokeMsgs(messages: MsgModel[], sender: string, deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
145
144
  sendDeleteMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;