about summary refs log tree commit diff
path: root/BugMine.Sdk
diff options
context:
space:
mode:
Diffstat (limited to 'BugMine.Sdk')
-rw-r--r--BugMine.Sdk/BugMineClient.cs1
-rw-r--r--BugMine.Sdk/BugMineIssue.cs4
-rw-r--r--BugMine.Sdk/BugMineProject.cs6
-rw-r--r--BugMine.Sdk/Events/State/BugMineRoomMetadata.cs2
-rw-r--r--BugMine.Sdk/Events/State/ProjectInfo.cs2
-rw-r--r--BugMine.Sdk/Events/Timeline/BugMineIssueComment.cs4
-rw-r--r--BugMine.Sdk/Events/Timeline/BugMineIssueData.cs6
7 files changed, 15 insertions, 10 deletions
diff --git a/BugMine.Sdk/BugMineClient.cs b/BugMine.Sdk/BugMineClient.cs
index d55ff4d..a012dde 100644
--- a/BugMine.Sdk/BugMineClient.cs
+++ b/BugMine.Sdk/BugMineClient.cs
@@ -1,6 +1,7 @@
 using System.Text.Json.Serialization;
 using System.Text.RegularExpressions;
 using ArcaneLibs.Extensions;
+using BugMine.Sdk.Events.State;
 using BugMine.Web.Classes.Exceptions;
 using LibMatrix;
 using LibMatrix.Homeservers;
diff --git a/BugMine.Sdk/BugMineIssue.cs b/BugMine.Sdk/BugMineIssue.cs
index 6cf3409..7b01b32 100644
--- a/BugMine.Sdk/BugMineIssue.cs
+++ b/BugMine.Sdk/BugMineIssue.cs
@@ -4,8 +4,8 @@ using LibMatrix.RoomTypes;
 namespace BugMine.Web.Classes;
 
 public class BugMineIssue(GenericRoom room, StateEventResponse data) {
-    public GenericRoom Room { get; } = room;
-    public StateEventResponse Data { get; } = data;
+    public GenericRoom Room => room ?? throw new ArgumentNullException(nameof(room));
+    public StateEventResponse Data => data ?? throw new ArgumentNullException(nameof(data));
     // public async IAsyncEnumerable<StateEventResponse> GetRelatedEventsAsync() {
     //     
     // }
diff --git a/BugMine.Sdk/BugMineProject.cs b/BugMine.Sdk/BugMineProject.cs
index 1f56659..453b597 100644
--- a/BugMine.Sdk/BugMineProject.cs
+++ b/BugMine.Sdk/BugMineProject.cs
@@ -1,4 +1,6 @@
 using ArcaneLibs.Extensions;
+using BugMine.Sdk.Events.State;
+using BugMine.Sdk.Events.Timeline;
 using LibMatrix.RoomTypes;
 
 namespace BugMine.Web.Classes;
@@ -37,8 +39,8 @@ public class BugMineProject(GenericRoom room) {
         return new BugMineIssue(Room, evt);
     }
 
-    public async IAsyncEnumerable<BugMineIssue> GetIssues() {
-        await foreach (var evt in room.GetRelatedEventsAsync(Metadata.RoomCreationEventId, "gay.rory.bugmine.issue", BugMineIssueData.EventId)) {
+    public async IAsyncEnumerable<BugMineIssue> GetIssues(int chunkLimit = 250) {
+        await foreach (var evt in room.GetRelatedEventsAsync(Metadata.RoomCreationEventId, "gay.rory.bugmine.issue", BugMineIssueData.EventId, chunkLimit: chunkLimit)) {
             yield return new BugMineIssue(Room, evt);
         }
     }
diff --git a/BugMine.Sdk/Events/State/BugMineRoomMetadata.cs b/BugMine.Sdk/Events/State/BugMineRoomMetadata.cs
index 734fd37..5fafa5a 100644
--- a/BugMine.Sdk/Events/State/BugMineRoomMetadata.cs
+++ b/BugMine.Sdk/Events/State/BugMineRoomMetadata.cs
@@ -1,6 +1,6 @@
 using LibMatrix.EventTypes;
 
-namespace BugMine.Web.Classes;
+namespace BugMine.Sdk.Events.State;
 
 [MatrixEvent(EventName = EventId)]
 public class BugMineRoomMetadata : EventContent {
diff --git a/BugMine.Sdk/Events/State/ProjectInfo.cs b/BugMine.Sdk/Events/State/ProjectInfo.cs
index 2d15bff..b1ec2d9 100644
--- a/BugMine.Sdk/Events/State/ProjectInfo.cs
+++ b/BugMine.Sdk/Events/State/ProjectInfo.cs
@@ -1,6 +1,6 @@
 using LibMatrix.EventTypes;
 
-namespace BugMine.Web.Classes;
+namespace BugMine.Sdk.Events.State;
 
 [MatrixEvent(EventName = EventId)]
 public class ProjectInfo : EventContent {
diff --git a/BugMine.Sdk/Events/Timeline/BugMineIssueComment.cs b/BugMine.Sdk/Events/Timeline/BugMineIssueComment.cs
index 50c73a1..782439a 100644
--- a/BugMine.Sdk/Events/Timeline/BugMineIssueComment.cs
+++ b/BugMine.Sdk/Events/Timeline/BugMineIssueComment.cs
@@ -1,10 +1,10 @@
 using LibMatrix.EventTypes;
 
-namespace BugMine.Web.Classes;
+namespace BugMine.Sdk.Events.Timeline;
 
 [MatrixEvent(EventName = EventId)]
 public class BugMineIssueComment : TimelineEventContent {
-    public const string EventId = "gay.rory.bugmine.comment";
+    public const string EventId = "gay.rory.bugmine.issue.comment";
     public string Comment { get; set; }
     public string Author { get; set; }
     public DateTime Timestamp { get; set; }
diff --git a/BugMine.Sdk/Events/Timeline/BugMineIssueData.cs b/BugMine.Sdk/Events/Timeline/BugMineIssueData.cs
index 480102a..859add3 100644
--- a/BugMine.Sdk/Events/Timeline/BugMineIssueData.cs
+++ b/BugMine.Sdk/Events/Timeline/BugMineIssueData.cs
@@ -1,8 +1,10 @@
+using BugMine.Sdk.Events.State;
+using BugMine.Web.Classes;
 using LibMatrix.EventTypes;
 
-namespace BugMine.Web.Classes;
+namespace BugMine.Sdk.Events.Timeline;
 
-[MatrixEvent(EventName = ProjectInfo.EventId)]
+[MatrixEvent(EventName = EventId)]
 public class BugMineIssueData : TimelineEventContent {
     public const string EventId = "gay.rory.bugmine.issue";
     public string Name { get; set; }