Skip to content

Commit

Permalink
Variables optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
Pozitronik authored and Pozitronik committed May 20, 2019
1 parent 3b648ff commit 67a539a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CloudMailRu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ TCloudMailRu = class

HTTP: TCloudMailRuHTTP; //HTTP transport class

public_download_token: WideString;
public_shard: WideString;
public_download_token: WideString; //token for public urls, refreshes on request
public_shard: WideString; //public downloads shard url

token: WideString;
OAuthToken: TCloudMailRuOAuthInfo;
x_page_id: WideString;
build: WideString;

upload_url: WideString;
login_method: integer;

Expand Down Expand Up @@ -744,6 +742,7 @@ function TCloudMailRu.getToken: Boolean;
var
JSON: WideString;
Progress: Boolean;
token, x_page_id, build: WideString;
begin
result := false;
if not(Assigned(self)) then
Expand All @@ -752,8 +751,8 @@ function TCloudMailRu.getToken: Boolean;
result := self.HTTP.GetPage(TOKEN_URL, JSON, Progress);
if result then
begin
result := extractTokenFromText(JSON, self.token) and extract_x_page_id_FromText(JSON, self.x_page_id) and extract_build_FromText(JSON, self.build) and extract_upload_url_FromText(JSON, self.upload_url);
self.united_params := '&api=2&build=' + self.build + '&x-page-id=' + self.x_page_id + '&email=' + self.user + '%40' + self.domain + '&x-email=' + self.user + '%40' + self.domain + '&token=' + self.token + '&_=' + DateTimeToUnix(now).ToString + '810';
result := extractTokenFromText(JSON, token) and extract_x_page_id_FromText(JSON, x_page_id) and extract_build_FromText(JSON, build) and extract_upload_url_FromText(JSON, self.upload_url);
self.united_params := '&api=2&build=' + build + '&x-page-id=' + x_page_id + '&email=' + self.user + '%40' + self.domain + '&x-email=' + self.user + '%40' + self.domain + '&token=' + token + '&_=' + DateTimeToUnix(now).ToString + '810';
end;
end;

Expand Down
Binary file modified MailRuCloud.wfx
Binary file not shown.

0 comments on commit 67a539a

Please sign in to comment.