Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Commit

Permalink
Updated JSON Keys
Browse files Browse the repository at this point in the history
  • Loading branch information
darmiel committed Nov 24, 2020
1 parent ca3c40f commit 5a69402
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public void execute(final MessageAnimation content,
animationObject.addProperty("duration", animation.duration);
animationObject.addProperty("width", animation.width);
animationObject.addProperty("height", animation.height);
animationObject.addProperty("filename", animation.fileName);
animationObject.addProperty("mime", animation.mimeType);
animationObject.addProperty("stickers", animation.hasStickers);
animationObject.addProperty("fileName", animation.fileName);
animationObject.addProperty("mimeType", animation.mimeType);
animationObject.addProperty("hasStickers", animation.hasStickers);

extra.add("animation", animationObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public void execute(final MessageAudio content,
final JsonObject audioObject = new JsonObject();
audioObject.addProperty("duration", audio.duration);
audioObject.addProperty("title", audio.title);
audioObject.addProperty("filename", audio.fileName);
audioObject.addProperty("mime", audio.mimeType);
audioObject.addProperty("fileName", audio.fileName);
audioObject.addProperty("mimeType", audio.mimeType);

extra.add("audio", audioObject);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public void execute(final MessageContact content,

final Contact contact = content.contact;
final JsonObject object = new JsonObject();
object.addProperty("phonenr", contact.phoneNumber);
object.addProperty("firstname", contact.firstName);
object.addProperty("lastname", contact.lastName);
object.addProperty("phoneNumber", contact.phoneNumber);
object.addProperty("firstName", contact.firstName);
object.addProperty("lastName", contact.lastName);
object.addProperty("vcard", contact.vcard);
object.addProperty("userid", contact.userId);
object.addProperty("userId", contact.userId);

extra.add("contact", object);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public void execute(final MessageDocument content,
// extra
final Document document = content.document;
final JsonObject object = new JsonObject();
object.addProperty("filename", document.fileName);
object.addProperty("mime", document.mimeType);
object.addProperty("fileName", document.fileName);
object.addProperty("mimeType", document.mimeType);

extra.add("document", object);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class GlobalJsonWrappers {
public static JsonObject wrapLocation(final TdApi.Location location, final Integer expiresIn) {
final JsonObject object = new JsonObject();
object.addProperty("latitude", location.latitude);
object.addProperty("longitude", location.longitude);
object.addProperty("latitude", location.longitude);
if (expiresIn != null) {
object.addProperty("expires", expiresIn);
object.addProperty("expiresIn", expiresIn);
}
return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public void execute(final MessagePoll content,
for (final PollOption option : poll.options) {
final JsonObject object = new JsonObject();
object.addProperty("text", option.text);
object.addProperty("votes", option.voterCount);
object.addProperty("voterCount", option.voterCount);
array.add(object);
}

final JsonObject object = new JsonObject();
object.addProperty("id", poll.id);
object.addProperty("totalvotes", poll.totalVoterCount);
object.addProperty("anonymous", poll.isAnonymous);
object.addProperty("closed", poll.isClosed);
object.addProperty("closedate", poll.closeDate);
object.addProperty("period", poll.openPeriod);
object.addProperty("totalVoterCount", poll.totalVoterCount);
object.addProperty("isAnonymous", poll.isAnonymous);
object.addProperty("isClosed", poll.isClosed);
object.addProperty("closeDate", poll.closeDate);
object.addProperty("openPeriod", poll.openPeriod);
object.addProperty("type",
poll.type.getConstructor() == PollTypeRegular.CONSTRUCTOR ? "REGULAR" : "QUIZ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void execute(final MessageSticker content,
object.addProperty("setId", sticker.setId);
object.addProperty("width", sticker.width);
object.addProperty("height", sticker.height);
object.addProperty("animated", sticker.isAnimated);
object.addProperty("isAnimated", sticker.isAnimated);

extra.add("sticker", object);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void execute(final MessageVideo content,
videoObject.addProperty("duration", video.duration);
videoObject.addProperty("width", video.width);
videoObject.addProperty("height", video.height);
videoObject.addProperty("filename", video.fileName);
videoObject.addProperty("mime", video.mimeType);
videoObject.addProperty("fileName", video.fileName);
videoObject.addProperty("mimeType", video.mimeType);

extra.add("video", videoObject);
}
Expand Down

0 comments on commit 5a69402

Please sign in to comment.