mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
deploy: 5d61266fd7
This commit is contained in:
+1
-147
@@ -120,58 +120,6 @@ refresh token for "Remember Me" sessions.</p>
|
||||
CM->>CM: Wire OnTokensRefreshed for config persistence
|
||||
CM->>CM: Continue to connection setup (see Connection Flow)
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Dialog UI</td>
|
||||
<td><code>src/EchoHub.Client/UI/Dialogs/ConnectDialog.cs</code></td>
|
||||
<td>Lines 251-268 (register handler)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Orchestrator entry</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 550-592 (<code>HandleConnect</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ConnectionManager auth</td>
|
||||
<td><code>src/EchoHub.Client/Services/ConnectionManager.cs</code></td>
|
||||
<td>Lines 74-76 (register branch)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ApiClient register</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 32-43 (<code>RegisterAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AuthController register</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/AuthController.cs</code></td>
|
||||
<td>Lines 28-49</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>UserService register</td>
|
||||
<td><code>src/EchoHub.Server/Services/UserService.cs</code></td>
|
||||
<td>Lines 20-59 (<code>RegisterUserAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>JWT generation</td>
|
||||
<td><code>src/EchoHub.Server/Auth/JwtTokenService.cs</code></td>
|
||||
<td>Lines 30-53 (access), 80-86 (refresh)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Token persistence</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 1039-1053 (<code>SaveServerToConfig</code>)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="user-login">User Login</h2>
|
||||
<p>Returning user authenticates with username/password or a saved refresh token.</p>
|
||||
@@ -202,53 +150,6 @@ refresh token for "Remember Me" sessions.</p>
|
||||
end
|
||||
API->>API: SetTokens()
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Login button handler</td>
|
||||
<td><code>src/EchoHub.Client/UI/Dialogs/ConnectDialog.cs</code></td>
|
||||
<td>Lines 214-249</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Saved token branch</td>
|
||||
<td><code>src/EchoHub.Client/Services/ConnectionManager.cs</code></td>
|
||||
<td>Lines 69-71</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password branch</td>
|
||||
<td><code>src/EchoHub.Client/Services/ConnectionManager.cs</code></td>
|
||||
<td>Lines 78-80</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ApiClient login</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 45-56 (<code>LoginAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AuthController login</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/AuthController.cs</code></td>
|
||||
<td>Lines 51-72</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>AuthController refresh</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/AuthController.cs</code></td>
|
||||
<td>Lines 74-108</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>UserService authenticate</td>
|
||||
<td><code>src/EchoHub.Server/Services/UserService.cs</code></td>
|
||||
<td>Lines 61-83</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="token-refresh">Token Refresh</h2>
|
||||
<p>Access tokens expire after 15 minutes. The client auto-refreshes transparently
|
||||
@@ -276,53 +177,6 @@ before requests and on 401 responses. Refresh tokens are rotated on each use.</p
|
||||
API-->>Config: Persist new refresh token (if Remember Me)
|
||||
API->>SR: Retry original request with new token
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Proactive check</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 110-129 (<code>GetValidTokenAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reactive 401 retry (GET)</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 338-358 (<code>AuthenticatedGetAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reactive 401 retry (POST/PUT/DELETE)</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 364-384 (<code>AuthenticatedRequestAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Refresh HTTP call</td>
|
||||
<td><code>src/EchoHub.Client/Services/ApiClient.cs</code></td>
|
||||
<td>Lines 58-71 (<code>RefreshTokenAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SignalR token provider</td>
|
||||
<td><code>src/EchoHub.Client/Services/EchoHubConnection.cs</code></td>
|
||||
<td>Line 37 (<code>AccessTokenProvider</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Server-side rotation</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/AuthController.cs</code></td>
|
||||
<td>Lines 74-108</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Token persistence callback</td>
|
||||
<td><code>src/EchoHub.Client/Services/ConnectionManager.cs</code></td>
|
||||
<td>Lines 253-264</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -344,7 +198,7 @@ before requests and on 401 responses. Refresh tokens are rotated on each use.</p
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-124
@@ -116,33 +116,6 @@ connected clients.</p>
|
||||
|
||||
CC-->>Client: 201 Created (ChannelDto)
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Controller endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ChannelsController.cs</code></td>
|
||||
<td>Lines 60-76</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Channel service create</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChannelService.cs</code></td>
|
||||
<td>Lines 50-90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Broadcast updated</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 308-309</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="channel-deletion">Channel Deletion</h2>
|
||||
<p>Only the channel creator (or admin) can delete a channel. The default channel
|
||||
@@ -162,28 +135,6 @@ is protected.</p>
|
||||
ChS-->>CC: Success
|
||||
CC-->>Client: 204 No Content
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Controller endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ChannelsController.cs</code></td>
|
||||
<td>Lines 94-106</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Channel service delete</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChannelService.cs</code></td>
|
||||
<td>Lines 119-144</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="joining-a-channel">Joining a Channel</h2>
|
||||
<p>Both SignalR and IRC clients join channels through <code>ChatService</code>. The presence
|
||||
@@ -221,48 +172,6 @@ broadcasts accordingly.</p>
|
||||
CS-->>Entry: (history, error)
|
||||
Entry-->>Client: History messages
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>SignalR hub join</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 59-81</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC join</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 361-414</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService join</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 96-135</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Presence join</td>
|
||||
<td><code>src/EchoHub.Server/Services/PresenceTracker.cs</code></td>
|
||||
<td>Lines 58-70</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SignalR broadcast</td>
|
||||
<td><code>src/EchoHub.Server/Services/SignalRBroadcaster.cs</code></td>
|
||||
<td>Lines 26-32</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC broadcast</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcBroadcaster.cs</code></td>
|
||||
<td>Lines 34-41</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="leaving-a-channel">Leaving a Channel</h2>
|
||||
<pre><code class="lang-mermaid">sequenceDiagram
|
||||
@@ -283,38 +192,6 @@ broadcasts accordingly.</p>
|
||||
CS->>IRCB: SendUserLeftAsync(channel, username)
|
||||
end
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>SignalR hub leave</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 83-96</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC part</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 416-435</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService leave</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 137-143</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Presence leave</td>
|
||||
<td><code>src/EchoHub.Server/Services/PresenceTracker.cs</code></td>
|
||||
<td>Lines 72-81</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -336,7 +213,7 @@ broadcasts accordingly.</p>
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-132
@@ -117,58 +117,6 @@ event handlers, joins the default channel, and loads history.</p>
|
||||
Hub-->>EHC: List<MessageDto> (encrypted)
|
||||
EHC-->>CM: Decrypted history
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Connection orchestration</td>
|
||||
<td><code>src/EchoHub.Client/Services/ConnectionManager.cs</code></td>
|
||||
<td>Lines 58-140 (<code>ConnectAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EchoHubConnection setup</td>
|
||||
<td><code>src/EchoHub.Client/Services/EchoHubConnection.cs</code></td>
|
||||
<td>Lines 29-62 (constructor)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Handler registration</td>
|
||||
<td><code>src/EchoHub.Client/Services/EchoHubConnection.cs</code></td>
|
||||
<td>Lines 64-122 (<code>RegisterHandlers</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hub OnConnected</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 31-43</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService connected</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 41-57</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PresenceTracker connect</td>
|
||||
<td><code>src/EchoHub.Server/Services/PresenceTracker.cs</code></td>
|
||||
<td>Lines 13-29</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Join channel (hub)</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 59-81</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Join channel (service)</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 96-135</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="irc-client-connection">IRC Client Connection</h2>
|
||||
<p>IRC clients connect via TCP, authenticate with PASS/NICK/USER or SASL PLAIN,
|
||||
@@ -213,53 +161,6 @@ and auto-join channels. New usernames are auto-registered.</p>
|
||||
|
||||
Note over IRC,CH: Client is now ready for JOIN/PART/PRIVMSG
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>TCP listener</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcGatewayService.cs</code></td>
|
||||
<td>Lines 45-90 (<code>ExecuteAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client handler</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcGatewayService.cs</code></td>
|
||||
<td>Lines 92-154 (<code>HandleClientAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Command read loop</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 40-98 (<code>RunAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SASL auth</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 136-207 (<code>HandleAuthenticateAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PASS/NICK/USER</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 209-267</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Registration completion</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 268-315 (<code>TryCompleteRegistrationAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cleanup on disconnect</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcGatewayService.cs</code></td>
|
||||
<td>Lines 136-153</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="user-disconnect--presence">User Disconnect & Presence</h2>
|
||||
<p>When a client disconnects, the presence tracker determines if the user has any
|
||||
@@ -287,38 +188,6 @@ notified.</p>
|
||||
end
|
||||
end
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>SignalR disconnect</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 45-57</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC cleanup</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcGatewayService.cs</code></td>
|
||||
<td>Lines 136-153</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService disconnect</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 59-94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Presence disconnect</td>
|
||||
<td><code>src/EchoHub.Server/Services/PresenceTracker.cs</code></td>
|
||||
<td>Lines 31-53</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -340,7 +209,7 @@ notified.</p>
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-107
@@ -111,38 +111,6 @@ and broadcast as a message with a download link.</p>
|
||||
CS->>DB: INSERT Message
|
||||
CS->>CS: BroadcastToAllAsync → fan out to clients
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Upload endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ChannelsController.cs</code></td>
|
||||
<td>Lines 108-200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>File validation</td>
|
||||
<td><code>src/EchoHub.Server/Services/FileValidationHelper.cs</code></td>
|
||||
<td>Lines 15-82</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>File storage</td>
|
||||
<td><code>src/EchoHub.Server/Services/FileStorageService.cs</code></td>
|
||||
<td>Lines 1-47</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>File download</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/FilesController.cs</code></td>
|
||||
<td>Lines 22-53</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="link-embed-resolution">Link Embed Resolution</h2>
|
||||
<p>When a message contains URLs, the server fetches OpenGraph metadata for preview
|
||||
@@ -168,48 +136,6 @@ embeds.</p>
|
||||
LE-->>CS: List<EmbedDto> (or null)
|
||||
Note over CS: Attached to MessageDto before broadcast
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Entry point</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 28-51 (<code>TryGetEmbedsAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>URL extraction</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 145-160</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Private IP blocking</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 162-181</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>OG tag parsing</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 187-210</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Theme color parsing</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 117-143</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService integration</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 194-201</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="server-directory-registration">Server Directory Registration</h2>
|
||||
<p>Public servers register with the EchoHubSpace directory for discoverability.</p>
|
||||
@@ -235,38 +161,6 @@ embeds.</p>
|
||||
|
||||
Note over SDS,Dir: Exponential backoff on disconnect (2s → 30s max)
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Service lifecycle</td>
|
||||
<td><code>src/EchoHub.Server/Services/ServerDirectoryService.cs</code></td>
|
||||
<td>Lines 29-122</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Registration</td>
|
||||
<td><code>src/EchoHub.Server/Services/ServerDirectoryService.cs</code></td>
|
||||
<td>Lines 195-212</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>User count polling</td>
|
||||
<td><code>src/EchoHub.Server/Services/ServerDirectoryService.cs</code></td>
|
||||
<td>Lines 154-187</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reconnection backoff</td>
|
||||
<td><code>src/EchoHub.Server/Services/ServerDirectoryService.cs</code></td>
|
||||
<td>Lines 77-82, 191</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -288,7 +182,7 @@ embeds.</p>
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-159
@@ -128,73 +128,6 @@ clients.</p>
|
||||
IRCB->>Clients: Send to each IRC conn (skip sender)
|
||||
end
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Input handler</td>
|
||||
<td><code>src/EchoHub.Client/UI/MainWindow.cs</code></td>
|
||||
<td>Lines 428-449 (<code>OnInputKeyDown</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Orchestrator dispatch</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 631-661 (<code>HandleMessageSubmitted</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Client encrypt + send</td>
|
||||
<td><code>src/EchoHub.Client/Services/EchoHubConnection.cs</code></td>
|
||||
<td>Lines 148-153 (<code>SendMessageAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hub receive</td>
|
||||
<td><code>src/EchoHub.Server/Hubs/ChatHub.cs</code></td>
|
||||
<td>Lines 98-111 (<code>SendMessage</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService process</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 145-241 (<code>SendMessageAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mute check</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 177-190</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Link embeds</td>
|
||||
<td><code>src/EchoHub.Server/Services/LinkEmbedService.cs</code></td>
|
||||
<td>Lines 28-51 (<code>TryGetEmbedsAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DB insert</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 208-221</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Broadcast fan-out</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 311-324 (<code>BroadcastToAllAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SignalR broadcast</td>
|
||||
<td><code>src/EchoHub.Server/Services/SignalRBroadcaster.cs</code></td>
|
||||
<td>Lines 23-24</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC broadcast</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcBroadcaster.cs</code></td>
|
||||
<td>Lines 17-32</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="sending-a-message-irc">Sending a Message (IRC)</h2>
|
||||
<p>Messages from IRC clients follow the same <code>ChatService</code> path but enter as
|
||||
@@ -223,38 +156,6 @@ plaintext (no app-layer encryption).</p>
|
||||
IRCB->>IRCB: Skip sender (IRC echo suppression)
|
||||
end
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PRIVMSG handler</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Lines 437-469</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Channel name conversion</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcCommandHandler.cs</code></td>
|
||||
<td>Line 680 (<code>IrcToEchoHubChannel</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ChatService (shared path)</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 145-241</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IRC echo suppression</td>
|
||||
<td><code>src/EchoHub.Server.Irc/IrcBroadcaster.cs</code></td>
|
||||
<td>Lines 25-26</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="receiving-a-message-tui-client">Receiving a Message (TUI Client)</h2>
|
||||
<p>When a message arrives via SignalR, the client decrypts it, adds it to the chat
|
||||
@@ -276,33 +177,6 @@ view, and optionally plays a notification sound for @mentions.</p>
|
||||
AO->>AO: PlayAsync() notification sound
|
||||
end
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>SignalR handler</td>
|
||||
<td><code>src/EchoHub.Client/Services/EchoHubConnection.cs</code></td>
|
||||
<td>Lines 64-71</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Orchestrator receive</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 372-383</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>@mention detection</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 378-382</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<h2 id="command-execution">Command Execution</h2>
|
||||
<p>Slash commands (<code>/status</code>, <code>/nick</code>, <code>/kick</code>, etc.) are parsed client-side and
|
||||
@@ -452,38 +326,6 @@ dispatched to appropriate handlers, which call REST APIs or SignalR methods.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Command detection</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 639-655</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Command dispatch</td>
|
||||
<td><code>src/EchoHub.Client/Commands/CommandHandler.cs</code></td>
|
||||
<td>Lines 34-69 (<code>HandleAsync</code>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Command handlers wired</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 97-117</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Individual handlers</td>
|
||||
<td><code>src/EchoHub.Client/AppOrchestrator.cs</code></td>
|
||||
<td>Lines 122-350</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -505,7 +347,7 @@ dispatched to appropriate handlers, which call REST APIs or SignalR methods.</p>
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
+1
-48
@@ -120,53 +120,6 @@ These actions force-disconnect the target and broadcast the event.</p>
|
||||
CS->>IRCB: ForceDisconnectUserAsync(connectionIds, reason)
|
||||
CS->>DB: Set Status=Invisible, LastSeenAt=now
|
||||
</code></pre>
|
||||
<p><strong>Code references:</strong></p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Step</th>
|
||||
<th>File</th>
|
||||
<th>Location</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Kick endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ModerationController.cs</code></td>
|
||||
<td>Lines 62-87</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ban endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ModerationController.cs</code></td>
|
||||
<td>Lines 89-112</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mute endpoint</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ModerationController.cs</code></td>
|
||||
<td>Lines 130-151</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Force disconnect</td>
|
||||
<td><code>src/EchoHub.Server/Controllers/ModerationController.cs</code></td>
|
||||
<td>Lines 232-256</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mute expiration</td>
|
||||
<td><code>src/EchoHub.Server/Services/MuteExpirationService.cs</code></td>
|
||||
<td>Lines 22-62</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Mute enforcement</td>
|
||||
<td><code>src/EchoHub.Server/Services/ChatService.cs</code></td>
|
||||
<td>Lines 177-190</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Presence force remove</td>
|
||||
<td><code>src/EchoHub.Server/Services/PresenceTracker.cs</code></td>
|
||||
<td>Lines 161-178</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</article>
|
||||
|
||||
@@ -188,7 +141,7 @@ These actions force-disconnect the target and broadcast the event.</p>
|
||||
<footer class="border-top text-secondary">
|
||||
<div class="container-xxl">
|
||||
<div class="flex-fill">
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a><span class='footer-sep'>·</span><span class='footer-credit'>Built with <a href='https://dotnet.github.io/docfx'>DocFX</a></span></div></div>
|
||||
<div class='footer-custom'><div class='footer-inner'><span class='footer-brand'>EchoHub</span><span class='footer-sep'>·</span><a href='https://github.com/HueByte/EchoHub'>GitHub</a><span class='footer-sep'>·</span><a href='https://echohub.voidcube.cloud'>Website</a></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user