File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1900,19 +1900,19 @@ export class WAStartupService {
19001900
19011901 public async fetchProfile ( instanceName : string , number ?: string ) {
19021902 const jid = number ? this . createJid ( number ) : this . client ?. user ?. id ;
1903-
1903+
19041904 this . logger . verbose ( 'Getting profile with jid: ' + jid ) ;
19051905 try {
19061906 this . logger . verbose ( 'Getting profile info' ) ;
1907- const business = await this . fetchBusinessProfile ( jid ) ;
1908-
1907+
19091908 if ( number ) {
19101909 const info = ( await this . whatsappNumber ( { numbers : [ jid ] } ) ) ?. shift ( ) ;
1911- const picture = await this . profilePicture ( jid ) ;
1912- const status = await this . getStatus ( jid ) ;
1913-
1910+ const picture = await this . profilePicture ( info ?. jid ) ;
1911+ const status = await this . getStatus ( info ?. jid ) ;
1912+ const business = await this . fetchBusinessProfile ( info ?. jid ) ;
1913+
19141914 return {
1915- wuid : jid ,
1915+ wuid : info ?. jid || jid ,
19161916 name : info ?. name ,
19171917 numberExists : info ?. exists ,
19181918 picture : picture ?. profilePictureUrl ,
@@ -1924,6 +1924,7 @@ export class WAStartupService {
19241924 } ;
19251925 } else {
19261926 const info = await waMonitor . instanceInfo ( instanceName ) ;
1927+ const business = await this . fetchBusinessProfile ( jid ) ;
19271928
19281929 return {
19291930 wuid : jid ,
You can’t perform that action at this time.
0 commit comments