Skip to content

Commit

Permalink
add support for viewing animations
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Sep 28, 2024
1 parent 4b1190b commit 4b953cb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.2.11"
#define NCHAT_VERSION "5.3.1"
23 changes: 22 additions & 1 deletion lib/tgchat/src/tgchat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,28 @@ void TgChat::Impl::TdMessageContentConvert(td::td_api::MessageContent& p_TdMessa
}
else if (p_TdMessageContent.get_id() == td::td_api::messageAnimation::ID)
{
p_Text = "[Animation]";
auto& messageAnimation = static_cast<td::td_api::messageAnimation&>(p_TdMessageContent);
auto& animation = messageAnimation.animation_;
p_Text = GetText(std::move(messageAnimation.caption_));

auto& animationFile = animation->animation_;
auto& localFile = animationFile->local_;
auto& localPath = localFile->path_;
FileInfo fileInfo;
std::string id = animationFile->remote_->id_;
fileInfo.fileId = id;
if (!localPath.empty())
{
fileInfo.filePath = localPath;
fileInfo.fileStatus = FileStatusDownloaded;
}
else
{
fileInfo.filePath = "[Animation]";
fileInfo.fileStatus = FileStatusNotDownloaded;
}

p_FileInfo = ProtocolUtil::FileInfoToHex(fileInfo);
}
else if (p_TdMessageContent.get_id() == td::td_api::messageAudio::ID)
{
Expand Down
2 changes: 1 addition & 1 deletion src/nchat.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man.
.TH NCHAT "1" "September 2024" "nchat 5.2.11" "User Commands"
.TH NCHAT "1" "September 2024" "nchat 5.3.1" "User Commands"
.SH NAME
nchat \- ncurses chat
.SH SYNOPSIS
Expand Down

0 comments on commit 4b953cb

Please sign in to comment.