aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/irc/source.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-08-17 03:09:52 +0800
committerRunxi Yu <me@runxiyu.org>2025-08-17 03:09:52 +0800
commit009a6e397651a9540b6c6bb74ef2230eeda9b577 (patch)
tree0a808670d95aba5804a73a558cc335a49d230aa6 /forged/internal/irc/source.go
parentRemove HTML templates from main server (diff)
downloadforge-009a6e397651a9540b6c6bb74ef2230eeda9b577.tar.gz
forge-009a6e397651a9540b6c6bb74ef2230eeda9b577.tar.zst
forge-009a6e397651a9540b6c6bb74ef2230eeda9b577.zip
Some mass renaming
Diffstat (limited to 'forged/internal/irc/source.go')
-rw-r--r--forged/internal/irc/source.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/forged/internal/irc/source.go b/forged/internal/irc/source.go
deleted file mode 100644
index d955f45..0000000
--- a/forged/internal/irc/source.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// SPDX-License-Identifier: MIT
-// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
-
-package irc
-
-import (
- "bytes"
-
- "go.lindenii.runxiyu.org/forge/forged/internal/misc"
-)
-
-type Source interface {
- AsSourceString() string
-}
-
-func parseSource(s []byte) Source {
- nick, userhost, found := bytes.Cut(s, []byte{'!'})
- if !found {
- return Server{name: misc.BytesToString(s)}
- }
-
- user, host, found := bytes.Cut(userhost, []byte{'@'})
- if !found {
- return Server{name: misc.BytesToString(s)}
- }
-
- return Client{
- Nick: misc.BytesToString(nick),
- User: misc.BytesToString(user),
- Host: misc.BytesToString(host),
- }
-}
-
-type Server struct {
- name string
-}
-
-func (s Server) AsSourceString() string {
- return s.name
-}
-
-type Client struct {
- Nick string
- User string
- Host string
-}
-
-func (c Client) AsSourceString() string {
- return c.Nick + "!" + c.User + "@" + c.Host
-}