M1 step 5: IRC App

- Chat: header (Buffer n/N, unread elsewhere, topic or connection
  state), wrapped hh:mm <nick> lines (own in accent, Mentions green,
  info grey), input line; Tab cycles Buffers, Fn+Up/Down scrolls back,
  Enter sends, Back leaves while the IRC Service keeps running
- /settings: server form (host, port, TLS, self-signed pinning, nick,
  SASL, NickServ, auto-join); Save & reconnect restarts the session
- Opening the App starts the IRC Service; viewing a Buffer clears its
  unread count; IrcSession gains a revision counter for redraws

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-02 15:14:59 +02:00
co-authored by Claude Opus 5.5
parent 74a341418e
commit 076baa77d1
8 changed files with 397 additions and 3 deletions
+3
View File
@@ -62,11 +62,13 @@ int IrcSession::bufferFor(const std::string& name, IrcBuffer::Type type) {
if (i >= 0) return i;
if (bufferCount() >= kMaxBuffers) return 0; // full: fall back to the server Buffer
buffers_.push_back({name, type, {}, 0, false, false, ""});
revision_++;
return bufferCount() - 1;
}
void IrcSession::setViewing(int buffer) {
viewing_ = buffer;
revision_++;
if (buffer >= 0 && buffer < bufferCount()) {
buffers_[buffer].unread = 0;
buffers_[buffer].mentioned = false;
@@ -87,6 +89,7 @@ bool IrcSession::mentionsMe(const std::string& text) const {
void IrcSession::add(int b, IrcLine::Kind kind, const std::string& nick, const std::string& text, int64_t utc,
bool mention) {
IrcBuffer& buf = buffers_[b];
revision_++;
IrcLine line{utc, kind, nick, text};
buf.lines.push_back(line);
if (buf.lines.size() > kLinesPerBuffer) buf.lines.pop_front();