Skip to content

Commit

Permalink
GetProfilePicThumb Alterado add ChatID
Browse files Browse the repository at this point in the history
  • Loading branch information
xByteMaster committed Jun 1, 2022
1 parent 201c5a7 commit d4e1117
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 148 deletions.
3 changes: 2 additions & 1 deletion Demo/WPPConnectDemo.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ uses
uFrDemo in 'uFrDemo.pas' {frDemo},
uFraGrupos in 'uFraGrupos.pas' {frameGrupos: TFrame},
uFraMEnsagensRecebidas in 'uFraMEnsagensRecebidas.pas' {frameMensagensRecebidas: TFrame},
uFraMensagensEnviadas in 'uFraMensagensEnviadas.pas' {frameMensagensEnviadas: TFrame};
uFraMensagensEnviadas in 'uFraMensagensEnviadas.pas' {frameMensagensEnviadas: TFrame},
u_Retorno_SendFileMensagem in 'u_Retorno_SendFileMensagem.pas';

{$R *.res}

Expand Down
111 changes: 1 addition & 110 deletions Demo/WPPConnectDemo.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
<FormType>dfm</FormType>
<DesignClass>TFrame</DesignClass>
</DCCReference>
<DCCReference Include="u_Retorno_SendFileMensagem.pas"/>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
Expand Down Expand Up @@ -243,20 +244,12 @@
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
Expand All @@ -269,10 +262,6 @@
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
Expand All @@ -285,20 +274,12 @@
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
Expand All @@ -311,200 +292,120 @@
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
Expand Down Expand Up @@ -593,9 +494,6 @@
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
Expand Down Expand Up @@ -1125,9 +1023,6 @@
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
Expand Down Expand Up @@ -1230,10 +1125,6 @@
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
Expand Down
1 change: 1 addition & 0 deletions Demo/uFrDemo.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -1782,6 +1782,7 @@ object frDemo: TfrDemo
inherited memo_unReadMessage: TMemo
Width = 1008
Height = 418
ExplicitTop = 89
ExplicitWidth = 1008
ExplicitHeight = 418
end
Expand Down
20 changes: 16 additions & 4 deletions Demo/uFrDemo.pas
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ TfrDemo = class(TForm)
procedure TWPPConnect1GetUnReadMessages(const Chats: TChatList);
procedure TWPPConnect1GetStatusMessage(const Result
: TResponseStatusMessage);
procedure TWPPConnect1GetProfilePicThumb(Sender: TObject; Base64: string);
procedure btnAbrirZapClick(Sender: TObject);
procedure ctbtnCategories0Items3Click(Sender: TObject);
procedure ctbtnCategories0Items4Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TWPPConnect1Get_sendFileMessage(const Mensagem: TMessagesClass);
procedure TWPPConnect1Get_sendListMessage(const Mensagem: TMessagesClass);
procedure TWPPConnect1Get_sendTextMessage(const Mensagem: TMessagesClass);
procedure TWPPConnect1GetProfilePicThumb(Sender: TObject; ProfilePicThumb: TResponseGetProfilePicThumb);
private
{ Private declarations }

Expand Down Expand Up @@ -498,22 +498,30 @@ procedure TfrDemo.TWPPConnect1GetMyNumber(Sender: TObject);
lblMeuNumero.Caption := 'Meu número: ' + TWPPConnect(Sender).MyNumber;
end;

procedure TfrDemo.TWPPConnect1GetProfilePicThumb(Sender: TObject;
Base64: string);
procedure TfrDemo.TWPPConnect1GetProfilePicThumb(Sender: TObject; ProfilePicThumb: TResponseGetProfilePicThumb);
var
LInput: TMemoryStream;
LOutput: TMemoryStream;
AStr: TStringList;
lThread: TThread;
wlo_Celular, wlo_Base64: string;
begin
//Necessário Recompilar o Projeto

wlo_Base64 := ProfilePicThumb.Base64; // imagem
wlo_Celular := Copy(ProfilePicThumb.id,1, pos('@', ProfilePicThumb.id) -1); // nr telefone

//frameMensagensRecebidas1.memo_unReadMessage.Lines.add(wlo_Celular);
//frameMensagensRecebidas1.memo_unReadMessage.Lines.add(wlo_Base64);

lThread := TThread.CreateAnonymousThread(
procedure
begin
try
LInput := TMemoryStream.Create;
LOutput := TMemoryStream.Create;
AStr := TStringList.Create;
AStr.Add(Base64);
AStr.Add(wlo_Base64);
AStr.SaveToStream(LInput);
LInput.Position := 0;
TNetEncoding.Base64.Decode( LInput, LOutput );
Expand Down Expand Up @@ -728,6 +736,10 @@ procedure TfrDemo.TWPPConnect1GetUnReadMessages(const Chats: TChatList);
frameMensagensRecebidas1.ed_profilePicThumbURL.Text :=
AChat.contact.profilePicThumb;

if frameMensagensRecebidas1.ed_profilePicThumbURL.Text <> '' then
TWPPConnect1.getProfilePicThumb(AChat.id);
//GetImagemProfile(AChat.contact.profilePicThumb, AChat.id);

TWPPConnect1.ReadMessages(AChat.id);

// if frameMensagensRecebidas1.chk_AutoResposta.Checked then
Expand Down
Loading

0 comments on commit d4e1117

Please sign in to comment.