public static Message FromJson(VkResponse response)
{
if (response.ContainsKey("message"))
{
response = response["message"];
}
var message = new Message
{
Unread = response.ContainsKey("unread") ? response["unread"] : 0,
Id = response["id"],
UserId = response["user_id"],
Date = response["date"],
ReadState = response["read_state"],
Type = response["out"],
Title = response["title"],
Body = response["body"],
Attachments = response["attachments"],
Geo = response["geo"],
ForwardedMessages = response["fwd_messages"],
ContainsEmojiSmiles = response["emoji"],
IsImportant = response["important"],
IsDeleted = response["deleted"],
FromId = response["from_id"],
// дополнительные поля бесед
ChatId = response["chat_id"],
ChatActiveIds = response["chat_active"],
UsersCount = response["users_count"],
AdminId = response["admin_id"],
PhotoPreviews = response,
ChatPushSettings = response["push_settings"],
Action = response["action"],
ActionMid = response["action_mid"],
ActionEmail = response["action_email"],
ActionText = response["action_text"],
Photo50 = response["photo_50"],
Photo100 = response["photo_100"],
Photo200 = response["photo_200"],
InRead = response["in_read"],
OutRead = response["out_read"]
};
return message;
}