about summary refs log tree commit diff
path: root/MatrixContentFilter/Abstractions/IContentFilter.cs
blob: 8bd01ffe4bb6bedbcc6c46823fb9f20adca2ae8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Diagnostics;
using LibMatrix;
using LibMatrix.Responses;

namespace MatrixContentFilter.Abstractions;

public abstract class IContentFilter {
    private protected abstract string GetFilterName();
    private protected abstract string GetEventTypeName();
    private protected abstract string? GetEventSubtypeName();
    private protected abstract string? GetMetricsPrefix();
    
    public virtual Task ProcessSyncAsync(SyncResponse syncEvent) {
        var type = this.GetType().FullName;
        Console.WriteLine($"WARNING: {type} does not implement ProcessSyncAsync(SyncResponse syncEvent)");
        if(Debugger.IsAttached)
            Debugger.Break();
        return Task.CompletedTask;
    }

    public virtual Task ProcessEventListAsync(List<StateEventResponse> events) {
        var type = this.GetType().FullName;
        Console.WriteLine($"WARNING: {type} does not implement ProcessEventListAsync(List<StateEventResponse> events)");
        if(Debugger.IsAttached)
            Debugger.Break();
        return Task.CompletedTask;
    }

    public int ActionCount { get; set; } = 0;
    
    
}