-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
currently returns: - copyright info - author info - website and irc channel - version - build date
- Loading branch information
1 parent
1156d54
commit 2348fc0
Showing
3 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use super::*; | ||
|
||
|
||
#[command_handler("INFO")] | ||
/// Syntax: INFO | ||
fn info_handler( | ||
_network: &Network, | ||
response: &dyn CommandResponse, | ||
_source: UserSource, | ||
server: &ClientServer, | ||
) -> CommandResult { | ||
let authors = include_str!("../../../../AUTHORS").trim_end(); | ||
let node = server.node(); | ||
let version = node.version(); | ||
let build_date = node.build_date(); | ||
|
||
let info_text = format!("Sable -- | ||
Copyright (c) 2021-2024 Sable Development Team | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Development is led by: | ||
{authors} | ||
A full list of contributors can be found in the git log. | ||
Visit the Sable website at: https://sable.chat/ | ||
Visit us on IRC at irc.libera.chat #libera-dev | ||
Version: {version} | ||
Build date: {build_date}"); | ||
|
||
for line in info_text.lines() { | ||
response.numeric(make_numeric!(Info, line)); | ||
} | ||
// TODO: send configuration info to opers | ||
// see: https://github.com/solanum-ircd/solanum/blob/main/modules/m_info.c#L788 | ||
response.numeric(make_numeric!(EndOfInfo)); | ||
Ok(()) | ||
} |
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 |
---|---|---|
|
@@ -42,6 +42,7 @@ mod handlers { | |
mod ban; | ||
mod cap; | ||
mod chathistory; | ||
mod info; | ||
mod invite; | ||
mod join; | ||
mod kick; | ||
|
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