Small fix in Systemcall management

This commit is contained in:
FlorianDahn 2019-03-20 13:44:44 +07:00
parent 582f005b35
commit da80af86e3
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Telegram.Bot.Types;
using TelegramBotBase.Sessions; using TelegramBotBase.Sessions;
namespace TelegramBotBase.Base namespace TelegramBotBase.Base
@ -22,6 +23,8 @@ namespace TelegramBotBase.Base
public bool Handled { get; set; } = false; public bool Handled { get; set; } = false;
public Message OriginalMessage { get; set; }
public SystemCallEventArgs() public SystemCallEventArgs()
{ {
@ -29,10 +32,11 @@ namespace TelegramBotBase.Base
} }
public SystemCallEventArgs(String Command, List<String> Parameters, long DeviceId, DeviceSession Device) public SystemCallEventArgs(String Command, List<String> Parameters, Message Message, long DeviceId, DeviceSession Device)
{ {
this.Command = Command; this.Command = Command;
this.Parameters = Parameters; this.Parameters = Parameters;
this.OriginalMessage = Message;
this.DeviceId = DeviceId; this.DeviceId = DeviceId;
this.Device = Device; this.Device = Device;
} }

View File

@ -219,10 +219,8 @@ namespace TelegramBotBase
//Is this a systemcall ? //Is this a systemcall ?
if (e.IsSystemCall && this.SystemCalls.Contains(e.SystemCommand)) if (e.IsSystemCall && this.SystemCalls.Contains(e.SystemCommand))
{ {
var sce = new SystemCallEventArgs(e.SystemCommand, e.SystemCallParameters, ds.DeviceId, ds); var sce = new SystemCallEventArgs(e.SystemCommand, e.SystemCallParameters, e.Message, ds.DeviceId, ds);
OnSystemCall(sce); OnSystemCall(sce);
return;
} }
FormBase activeForm = null; FormBase activeForm = null;