Update to fix some bad behaviour with combination of AutoCleanForm
This commit is contained in:
parent
e81e5f1854
commit
1caa71cd25
@ -159,6 +159,22 @@ namespace TelegramBotBase.Controls.Hybrid
|
||||
}
|
||||
}
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
this.Device.MessageDeleted += Device_MessageDeleted;
|
||||
}
|
||||
|
||||
private void Device_MessageDeleted(object sender, MessageDeletedEventArgs e)
|
||||
{
|
||||
if (this.MessageId == null)
|
||||
return;
|
||||
|
||||
if (e.MessageId != this.MessageId)
|
||||
return;
|
||||
|
||||
this.MessageId = null;
|
||||
}
|
||||
|
||||
public async override Task Load(MessageResult result)
|
||||
{
|
||||
if (this.KeyboardType != eKeyboardType.ReplyKeyboard)
|
||||
@ -579,6 +595,11 @@ namespace TelegramBotBase.Controls.Hybrid
|
||||
{
|
||||
this.Updated();
|
||||
}
|
||||
else
|
||||
{
|
||||
//Remove event handler
|
||||
this.Device.MessageDeleted -= Device_MessageDeleted;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user