Files

79 lines
1.6 KiB
Go
Raw Permalink Normal View History

2021-11-14 06:31:51 +02:00
// gorc project
// Copyright (C) 2022 IllusionMan1212
2021-11-14 06:31:51 +02:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, see https://www.gnu.org/licenses.
package cmds
import (
2022-02-19 16:24:39 +02:00
"time"
tea "github.com/charmbracelet/bubbletea"
"github.com/illusionman1212/gorc/irc"
)
type ConnectMsg struct{}
func Connect() tea.Msg {
return ConnectMsg{}
}
func Quit(client *irc.Client) tea.Cmd {
return func() tea.Msg {
if client.TCPConn != nil {
client.SendCommand("QUIT")
}
return tea.Quit()
}
}
type SendPrivMsgMsg struct {
Msg string
Datetime time.Time
2022-01-05 00:54:54 +02:00
}
func SendPrivMsg(msg string) tea.Cmd {
2022-01-05 00:54:54 +02:00
return func() tea.Msg {
2022-02-19 16:24:39 +02:00
return SendPrivMsgMsg{
Msg: msg,
Datetime: time.Now(),
2022-02-19 16:24:39 +02:00
}
2022-01-05 00:54:54 +02:00
}
}
type ReceivedIRCMsgMsg struct{}
func ReceivedIRCMsg() tea.Msg {
return ReceivedIRCMsgMsg{}
}
type SwitchChannelsMsg struct{}
func SwitchChannels() tea.Msg {
return SwitchChannelsMsg{}
}
2025-08-15 21:35:27 +02:00
type UpdateNicksMsg struct{}
func UpdateNicks() tea.Msg {
return UpdateNicksMsg{}
}
type UpdateTabBarMsg struct{}
func UpdateTabBar() tea.Msg {
return UpdateTabBarMsg{}
}