Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 1974fec

Browse files
authored
Merge pull request #122 from cyanray/dev/cyanray
初始化 MiraiVoice, VoiceMessage 的 Length 字段.
2 parents fba036f + 2a82757 commit 1974fec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/mirai/defs/qq_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ namespace Cyan
137137
/**
138138
* @brief 语音长度
139139
*/
140-
size_t Length;
140+
size_t Length = 0;
141141
};
142142

143143
/**

include/mirai/messages/VoiceMessage.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace Cyan
1111
{
1212
public:
1313
VoiceMessage() {}
14-
VoiceMessage(const MiraiVoice& m) : voiceId_(m.Id), url_(m.Url), path_(m.Path) {}
15-
VoiceMessage(const VoiceMessage& m) : voiceId_(m.voiceId_), url_(m.voiceId_), path_(m.path_) {}
14+
VoiceMessage(const MiraiVoice& m) : voiceId_(m.Id), url_(m.Url), path_(m.Path), length_(0) {}
15+
VoiceMessage(const VoiceMessage& m) : voiceId_(m.voiceId_), url_(m.voiceId_), path_(m.path_), length_(m.length_) {}
1616
VoiceMessage(VoiceMessage&& m) noexcept
1717
{
1818
std::swap(this->voiceId_, m.voiceId_);

0 commit comments

Comments
 (0)