added option to view json

This commit is contained in:
Santiago Lema 2025-05-10 01:47:05 -03:00
parent 2df9419ce2
commit 67997aa2b1
4 changed files with 38 additions and 4 deletions

View file

@ -122,8 +122,9 @@ void Conversation::MessageReceived(BMessage *message) {
try {
printf("full Reply as text:%s",body.text.value().String());
json parsed = json::parse(body.text.value().String());
//printf("full Reply as text:%s",body.text.value().String());
auto fullBody =body.text.value().String();
json parsed = json::parse(fullBody);
printf("Parsed..\n");
std::string objType = parsed["object"];
@ -159,6 +160,7 @@ void Conversation::MessageReceived(BMessage *message) {
// printf("we got content:%s",content.c_str());
BMessage message(kSendReply);
message.AddString("text", BString(content.c_str()));
message.AddString("json", BString(fullBody));
sendReply(message);
}