This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from noobot/loredous-ReactionHandling
Loredous reaction handling
- Loading branch information
Showing
22 changed files
with
709 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ internal enum MessageType | |
Channel_Joined, | ||
Im_Created, | ||
Team_Join, | ||
Pong | ||
Pong, | ||
Reaction_Added | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/FileCommentReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
internal class FileCommentReaction : IReactionItem | ||
{ | ||
[JsonProperty("file")] | ||
public string File { get; set; } | ||
|
||
[JsonProperty("file_comment")] | ||
public string FileComment { get; set; } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/FileReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
internal class FileReaction : IReactionItem | ||
{ | ||
public string File { get; set; } | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/IReactionItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
interface IReactionItem | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/MessageReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
internal class MessageReaction : IReactionItem | ||
{ | ||
[JsonProperty("channel")] | ||
public string Channel { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/ReactionItemType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
internal enum ReactionItemType | ||
{ | ||
unknown = 0, | ||
message, | ||
file, | ||
file_comment | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionItem/UnknownReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem | ||
{ | ||
internal class UnknownReaction : IReactionItem | ||
{ | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/SlackConnector/Connections/Sockets/Messages/Inbound/ReactionMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Newtonsoft.Json; | ||
using SlackConnector.Connections.Sockets.Messages.Inbound.ReactionItem; | ||
|
||
namespace SlackConnector.Connections.Sockets.Messages.Inbound | ||
{ | ||
internal class ReactionMessage : InboundMessage | ||
{ | ||
public ReactionMessage() | ||
{ | ||
MessageType = MessageType.Reaction_Added; | ||
} | ||
|
||
[JsonProperty("user")] | ||
public string User { get; set; } | ||
|
||
[JsonProperty("reaction")] | ||
public string Reaction { get; set; } | ||
|
||
[JsonProperty("event_ts")] | ||
public double Timestamp { get; set; } | ||
|
||
public IReactionItem ReactingTo { get; set; } | ||
|
||
[JsonProperty("item_user")] | ||
public string ReactingToUser { get; set; } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/SlackConnector/EventHandlers/ReactionRecievedEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Threading.Tasks; | ||
using SlackConnector.Models; | ||
|
||
namespace SlackConnector.EventHandlers | ||
{ | ||
public delegate Task ReactionReceivedEventHandler(ISlackReaction message); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SlackConnector.Models | ||
{ | ||
public interface ISlackReaction | ||
{ | ||
string RawData { get; } | ||
SlackUser User { get; } | ||
double Timestamp { get; } | ||
string Reaction { get; } | ||
SlackUser ReactingToUser { get; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/SlackConnector/Models/Reactions/SlackFileCommentReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SlackConnector.Models.Reactions | ||
{ | ||
public class SlackFileCommentReaction : ISlackReaction | ||
{ | ||
public string RawData { get; internal set; } | ||
public SlackUser User { get; internal set; } | ||
public double Timestamp { get; internal set; } | ||
public string Reaction { get; internal set; } | ||
public string File { get; internal set; } | ||
public string FileComment { get; internal set; } | ||
public SlackUser ReactingToUser { get; internal set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace SlackConnector.Models.Reactions | ||
{ | ||
public class SlackFileReaction : ISlackReaction | ||
{ | ||
public string RawData { get; internal set; } | ||
public SlackUser User { get; internal set; } | ||
public double Timestamp { get; internal set; } | ||
public string Reaction { get; internal set; } | ||
public string File { get; internal set; } | ||
public SlackUser ReactingToUser { get; internal set; } | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/SlackConnector/Models/Reactions/SlackMessageReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace SlackConnector.Models.Reactions | ||
{ | ||
public class SlackMessageReaction : ISlackReaction | ||
{ | ||
public SlackChatHub ChatHub { get; internal set; } | ||
public string RawData { get; internal set; } | ||
public SlackUser User { get; internal set; } | ||
public double Timestamp { get; internal set; } | ||
public string Reaction { get; internal set; } | ||
public SlackUser ReactingToUser { get; internal set; } | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/SlackConnector/Models/Reactions/SlackUnknownReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace SlackConnector.Models.Reactions | ||
{ | ||
public class SlackUnknownReaction : ISlackReaction | ||
{ | ||
public string RawData { get; internal set; } | ||
public SlackUser User { get; internal set; } | ||
public double Timestamp { get; internal set; } | ||
public string Reaction { get; internal set; } | ||
public SlackUser ReactingToUser { get; internal set; } | ||
} | ||
} |
Oops, something went wrong.