Adds successful peer-dial event
This commit is contained in:
parent
8e084d6ca0
commit
7352cdf3fe
|
@ -53,7 +53,7 @@ namespace CodexPlugin
|
|||
"connmanager",
|
||||
"websock",
|
||||
"ws-session",
|
||||
"dialer",
|
||||
// Removed: "dialer", is used for transcript event generation.
|
||||
"muxedupgrade",
|
||||
"upgrade",
|
||||
"identify"
|
||||
|
|
|
@ -56,7 +56,8 @@ namespace CodexPlugin.OverwatchSupport
|
|||
private readonly ILineConverter[] converters = new ILineConverter[]
|
||||
{
|
||||
new BlockReceivedLineConverter(),
|
||||
new BootstrapLineConverter()
|
||||
new BootstrapLineConverter(),
|
||||
new DialSuccessfulLineConverter(),
|
||||
};
|
||||
|
||||
public ConversionRunner(ITranscriptWriter writer, string name, string peerId)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
namespace CodexPlugin.OverwatchSupport.LineConverters
|
||||
{
|
||||
public class DialSuccessfulLineConverter : ILineConverter
|
||||
{
|
||||
public string Interest => "Dial successful";
|
||||
|
||||
public void Process(CodexLogLine line, Action<Action<OverwatchCodexEvent>> addEvent)
|
||||
{
|
||||
var peerId = line.Attributes["peerId"];
|
||||
|
||||
addEvent(e =>
|
||||
{
|
||||
e.DialSuccessful = new DialSuccessfulEvent
|
||||
{
|
||||
TargetPeerId = peerId
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ namespace CodexPlugin.OverwatchSupport
|
|||
public FileUploadedEvent? FileUploaded { get; set; }
|
||||
public FileDownloadedEvent? FileDownloaded { get; set; }
|
||||
public BlockReceivedEvent? BlockReceived { get; set; }
|
||||
public DialSuccessfulEvent? DialSuccessful { get; set; }
|
||||
|
||||
public void Write(DateTime utc, ITranscriptWriter writer)
|
||||
{
|
||||
|
@ -96,5 +97,11 @@ namespace CodexPlugin.OverwatchSupport
|
|||
public string SenderPeerId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class DialSuccessfulEvent
|
||||
{
|
||||
public string TargetPeerId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue