Don't register VoiceNote and VideoNote messages for bots.
This commit is contained in:
parent
f43956f25d
commit
1d672470ea
@ -171,7 +171,8 @@ void VideoNotesManager::create_video_note(FileId file_id, string minithumbnail,
|
|||||||
|
|
||||||
void VideoNotesManager::register_video_note(FileId video_note_file_id, FullMessageId full_message_id,
|
void VideoNotesManager::register_video_note(FileId video_note_file_id, FullMessageId full_message_id,
|
||||||
const char *source) {
|
const char *source) {
|
||||||
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server()) {
|
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server() ||
|
||||||
|
td_->auth_manager_->is_bot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(INFO) << "Register video note " << video_note_file_id << " from " << full_message_id << " from " << source;
|
LOG(INFO) << "Register video note " << video_note_file_id << " from " << full_message_id << " from " << source;
|
||||||
@ -183,7 +184,8 @@ void VideoNotesManager::register_video_note(FileId video_note_file_id, FullMessa
|
|||||||
|
|
||||||
void VideoNotesManager::unregister_video_note(FileId video_note_file_id, FullMessageId full_message_id,
|
void VideoNotesManager::unregister_video_note(FileId video_note_file_id, FullMessageId full_message_id,
|
||||||
const char *source) {
|
const char *source) {
|
||||||
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server()) {
|
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server() ||
|
||||||
|
td_->auth_manager_->is_bot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(INFO) << "Unregister video note " << video_note_file_id << " from " << full_message_id << " from " << source;
|
LOG(INFO) << "Unregister video note " << video_note_file_id << " from " << full_message_id << " from " << source;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
#include "td/telegram/VoiceNotesManager.h"
|
#include "td/telegram/VoiceNotesManager.h"
|
||||||
|
|
||||||
|
#include "td/telegram/AuthManager.h"
|
||||||
#include "td/telegram/Dimensions.h"
|
#include "td/telegram/Dimensions.h"
|
||||||
#include "td/telegram/files/FileManager.h"
|
#include "td/telegram/files/FileManager.h"
|
||||||
#include "td/telegram/Global.h"
|
#include "td/telegram/Global.h"
|
||||||
@ -134,7 +135,8 @@ void VoiceNotesManager::create_voice_note(FileId file_id, string mime_type, int3
|
|||||||
|
|
||||||
void VoiceNotesManager::register_voice_note(FileId voice_note_file_id, FullMessageId full_message_id,
|
void VoiceNotesManager::register_voice_note(FileId voice_note_file_id, FullMessageId full_message_id,
|
||||||
const char *source) {
|
const char *source) {
|
||||||
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server()) {
|
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server() ||
|
||||||
|
td_->auth_manager_->is_bot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(INFO) << "Register voice note " << voice_note_file_id << " from " << full_message_id << " from " << source;
|
LOG(INFO) << "Register voice note " << voice_note_file_id << " from " << full_message_id << " from " << source;
|
||||||
@ -146,7 +148,8 @@ void VoiceNotesManager::register_voice_note(FileId voice_note_file_id, FullMessa
|
|||||||
|
|
||||||
void VoiceNotesManager::unregister_voice_note(FileId voice_note_file_id, FullMessageId full_message_id,
|
void VoiceNotesManager::unregister_voice_note(FileId voice_note_file_id, FullMessageId full_message_id,
|
||||||
const char *source) {
|
const char *source) {
|
||||||
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server()) {
|
if (full_message_id.get_message_id().is_scheduled() || !full_message_id.get_message_id().is_server() ||
|
||||||
|
td_->auth_manager_->is_bot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG(INFO) << "Unregister voice note " << voice_note_file_id << " from " << full_message_id << " from " << source;
|
LOG(INFO) << "Unregister voice note " << voice_note_file_id << " from " << full_message_id << " from " << source;
|
||||||
|
Loading…
Reference in New Issue
Block a user