summaryrefslogtreecommitdiff
path: root/src/TgTypeParser.cpp
diff options
context:
space:
mode:
authorkukin-konstantin <kukin.konstantin@gmail.com>2017-01-12 18:01:49 +0300
committerkukin-konstantin <kukin.konstantin@gmail.com>2017-01-12 18:01:49 +0300
commit19a83123e908e8d80b404d47ec843fa6f0d4a5a6 (patch)
treeeae827328055dde732bd8fff66500c1bf0051aac /src/TgTypeParser.cpp
parent54a50a7c8a7e9d15c03bdb64babe54e5c123e5c7 (diff)
fix parse Array error
Diffstat (limited to 'src/TgTypeParser.cpp')
-rw-r--r--src/TgTypeParser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/TgTypeParser.cpp b/src/TgTypeParser.cpp
index 0952d75..f22a868 100644
--- a/src/TgTypeParser.cpp
+++ b/src/TgTypeParser.cpp
@@ -467,7 +467,8 @@ std::string TgTypeParser::parseReplyKeyboardMarkup(const ReplyKeyboardMarkup::Pt
result.erase(result.length() - 1);
result += "],";
}
- result.erase(result.length() - 1);
+ if (!object->keyboard.empty())
+ result.erase(result.length() - 1);
result += "],";
appendToJson(result, "resize_keyboard", object->resizeKeyboard);
appendToJson(result, "one_time_keyboard", object->oneTimeKeyboard);
@@ -1329,7 +1330,8 @@ std::string TgTypeParser::parseInlineKeyboardMarkup(const InlineKeyboardMarkup::
result.erase(result.length() - 1);
result += "],";
}
- result.erase(result.length() - 1);
+ if (!object->inlineKeyboard.empty())
+ result.erase(result.length() - 1);
result += "]}";
return result;
}