mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-06-25 11:22:57 +03:00
Compare commits
No commits in common. "a102d0d2600fab849ada593d6f1c9c6a0036be57" and "23d8ebffb537f524dc88879f04da7731f7406a41" have entirely different histories.
a102d0d260
...
23d8ebffb5
769
Cargo.lock
generated
769
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -17,7 +17,6 @@ chrono = "0.4.40"
|
|||||||
serde_default = "0.2.0"
|
serde_default = "0.2.0"
|
||||||
socks = "0.3.4"
|
socks = "0.3.4"
|
||||||
libnotify = { version = "1.0.3", optional = true }
|
libnotify = { version = "1.0.3", optional = true }
|
||||||
notify-rust = { version = "4.11.7", optional = true }
|
|
||||||
gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
|
gdk-pixbuf = { version = "0.3.0", optional = true } # DO NOT UPDATE
|
||||||
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
|
winapi = { version = "0.3.9", optional = true, features = ["wincon", "winuser"] }
|
||||||
tungstenite = "0.27.0"
|
tungstenite = "0.27.0"
|
||||||
@ -25,7 +24,6 @@ tungstenite = "0.27.0"
|
|||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
libnotify = ["dep:libnotify", "dep:gdk-pixbuf"]
|
libnotify = ["dep:libnotify", "dep:gdk-pixbuf"]
|
||||||
notify-rust = ["dep:notify-rust"]
|
|
||||||
winapi = ["dep:winapi"]
|
winapi = ["dep:winapi"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
14
README.md
14
README.md
@ -13,12 +13,13 @@ better RAC client
|
|||||||
- RACv1.99.x and RACv2.0 compatible
|
- RACv1.99.x and RACv2.0 compatible
|
||||||
- WRAC compatible ([docs](docs/wrac.md))
|
- WRAC compatible ([docs](docs/wrac.md))
|
||||||
- chat commands (type /help)
|
- chat commands (type /help)
|
||||||
- no ip and date visible for anyone (almost)
|
- no ip and date visible for anyone
|
||||||
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc.)
|
- uses TOR proxy server by default (meex.lol:11234)
|
||||||
- many command-line options (see --help)
|
- coloring usernames by their clients (CRAB, clRAC, Mefidroniy, etc)
|
||||||
- rich configuration (--config-path to get file path)
|
- many command-line options (--help)
|
||||||
- RACS/WRACS compatible (ex: wracs://meex.lol)
|
- rich configuration (--config-path to get file path and --configure to edit)
|
||||||
- reading messages chunked (less traffic usage)
|
- RACS compatible (--enable-ssl or in --configure enable SSL)
|
||||||
|
- chunked reading messages
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -89,7 +90,6 @@ messages starting with a slash are sent to chat only if the `--disable-commands`
|
|||||||
- [User agents](docs/user_agents.md)
|
- [User agents](docs/user_agents.md)
|
||||||
- [Authenticated mode](docs/auth_mode.md)
|
- [Authenticated mode](docs/auth_mode.md)
|
||||||
- [WRAC protocol (v2.0)](docs/wrac.md)
|
- [WRAC protocol (v2.0)](docs/wrac.md)
|
||||||
- [About RAC URL](docs/url.md)
|
|
||||||
- [FAQ](docs/faq.md)
|
- [FAQ](docs/faq.md)
|
||||||
|
|
||||||
## see also
|
## see also
|
||||||
|
@ -4,16 +4,17 @@
|
|||||||
|
|
||||||
1. Install [rustup](https://rustup.rs/)
|
1. Install [rustup](https://rustup.rs/)
|
||||||
2. Install [MSVC](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and run `rustup default stable-msvc`
|
2. Install [MSVC](https://visualstudio.microsoft.com/visual-cpp-build-tools/) and run `rustup default stable-msvc`
|
||||||
3. Extract [GTK4 from gvsbuild](https://github.com/wingtk/gvsbuild/releases/latest) to `C:\gtk`
|
3. Extract [GTK4 from gvsbuild](https://github.com/wingtk/gvsbuild/releases/tag/latest) to `C:\gtk`
|
||||||
4. Update environment variables:
|
4. Update environment variables:
|
||||||
- Go to Start, search for 'Advanced system settings' (or click on Properties of My Computer in the Explorer, then you'll find 'Advanced system settings')
|
- Go to Start
|
||||||
|
- Search for 'Advanced system settings'
|
||||||
- Click 'Environment Variables...'
|
- Click 'Environment Variables...'
|
||||||
- Add `C:\gtk\lib\pkgconfig` to the PKG_CONFIG_PATH variable (or create one if doesnt exist)
|
- Add `C:\gtk\lib\pkgconfig` to the PKG_CONFIG_PATH variable
|
||||||
- Add `C:\gtk\bin` to the PATH variable (or create one if doesnt exist)
|
- Add `C:\gtk\bin` to the PATH variable
|
||||||
- Add `C:\gtk\lib` to the Lib variable (or create one if doesnt exist)
|
- Add `C:\gtk\lib` to the Lib variable
|
||||||
- Apply and close the window (maybe restart PC)
|
- Save and exit
|
||||||
5. Open the repository directory in console (download it from github or with `git clone https://github.com/MeexReay/bRAC.git`)
|
5. Open the repository directory in console (download it from github or with `git clone https://github.com/MeexReay/bRAC.git`)
|
||||||
6. Run `cargo build -r -F winapi,notify-rust`
|
6. Run `cargo build -r -F libnotify winapi`
|
||||||
7. Done! Your finished binary is in the `target/release` folder.
|
7. Done! Your finished binary is in the `target/release` folder.
|
||||||
|
|
||||||
## Linux / MacOS
|
## Linux / MacOS
|
||||||
@ -25,36 +26,22 @@
|
|||||||
|
|
||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
## Windows
|
## Windows / MacOS
|
||||||
|
|
||||||
### Black frame around the window
|
### Doesnt compile / doesnt work
|
||||||
|
|
||||||
Black frame appears on connecting to the server or when bRAC just freezes. Be patient.
|
Write a new issue here and dont google anything!!1
|
||||||
|
|
||||||
## MacOS
|
|
||||||
|
|
||||||
### Notifications dont work
|
|
||||||
|
|
||||||
There are two solutions:
|
|
||||||
|
|
||||||
- Switch to `libnotify`:
|
|
||||||
|
|
||||||
Add the feature `libnotify` to cargo: `cargo build -r -F libnotify`
|
|
||||||
|
|
||||||
- Switch to `notify-rust`:
|
|
||||||
|
|
||||||
Add the feature `notify-rust` to cargo: `cargo build -r -F notify-rust`
|
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
|
|
||||||
### Notifications dont work
|
### Notifications dont work
|
||||||
|
|
||||||
There are two solutions:
|
There are Two solutions:
|
||||||
|
|
||||||
- Switch to `libnotify`:
|
- Switch to `libnotify`:
|
||||||
|
|
||||||
Just add the new feature to cargo: `cargo build -r -F libnotify` \
|
Just add the new feature to cargo: `cargo build -r -F libnotify` \
|
||||||
Libnotify sucks in many situations, but it always work
|
Libnotify sucks in many situations, but its cross-compiling and always work
|
||||||
|
|
||||||
- Make a desktop file:
|
- Make a desktop file:
|
||||||
|
|
||||||
|
16
docs/url.md
16
docs/url.md
@ -1,16 +0,0 @@
|
|||||||
# How does RAC URL work?
|
|
||||||
|
|
||||||
RAC URL is used in sRAC and bRAC as the default way of specifying host, running a RAC or WRAC server.
|
|
||||||
|
|
||||||
Format of RAC URL:
|
|
||||||
|
|
||||||
```
|
|
||||||
<protocol>://<address>[:<port>]
|
|
||||||
```
|
|
||||||
|
|
||||||
Protocol can be one of these:
|
|
||||||
|
|
||||||
| | **SSL** | **No SSL** |
|
|
||||||
| :--: | :--: | :--: |
|
|
||||||
| **WebSocket** | wracs:// | wrac:// |
|
|
||||||
| **No Websocket** | racs:// | rac:// |
|
|
@ -22,7 +22,7 @@ pub fn default_konata_size() -> usize {
|
|||||||
100
|
100
|
||||||
}
|
}
|
||||||
pub fn default_host() -> String {
|
pub fn default_host() -> String {
|
||||||
"wracs://meex.lol".to_string()
|
"meex.lol:11234".to_string()
|
||||||
}
|
}
|
||||||
pub fn default_message_format() -> String {
|
pub fn default_message_format() -> String {
|
||||||
MESSAGE_FORMAT.to_string()
|
MESSAGE_FORMAT.to_string()
|
||||||
|
@ -41,7 +41,7 @@ struct UiModel {
|
|||||||
window: ApplicationWindow,
|
window: ApplicationWindow,
|
||||||
#[cfg(feature = "libnotify")]
|
#[cfg(feature = "libnotify")]
|
||||||
notifications: Arc<RwLock<Vec<libnotify::Notification>>>,
|
notifications: Arc<RwLock<Vec<libnotify::Notification>>>,
|
||||||
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
|
#[cfg(not(feature = "libnotify"))]
|
||||||
notifications: Arc<RwLock<Vec<String>>>,
|
notifications: Arc<RwLock<Vec<String>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ fn build_ui(ctx: Arc<Context>, app: &Application) -> UiModel {
|
|||||||
window: window.clone(),
|
window: window.clone(),
|
||||||
#[cfg(feature = "libnotify")]
|
#[cfg(feature = "libnotify")]
|
||||||
notifications: Arc::new(RwLock::new(Vec::<libnotify::Notification>::new())),
|
notifications: Arc::new(RwLock::new(Vec::<libnotify::Notification>::new())),
|
||||||
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
|
#[cfg(not(feature = "libnotify"))]
|
||||||
notifications: Arc::new(RwLock::new(Vec::<String>::new())),
|
notifications: Arc::new(RwLock::new(Vec::<String>::new())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -805,7 +805,6 @@ fn setup(_: &Application, ctx: Arc<Context>, ui: UiModel) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
#[cfg(not(feature = "notify-rust"))]
|
|
||||||
GLOBAL.with(|global| {
|
GLOBAL.with(|global| {
|
||||||
if let Some(ui) = &*global.borrow() {
|
if let Some(ui) = &*global.borrow() {
|
||||||
#[cfg(feature = "libnotify")]
|
#[cfg(feature = "libnotify")]
|
||||||
@ -869,20 +868,6 @@ fn load_css(is_dark_theme: bool) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "notify-rust")]
|
|
||||||
fn send_notification(_: Arc<Context>, _: &UiModel, title: &str, message: &str) {
|
|
||||||
use notify_rust::{Notification, Timeout};
|
|
||||||
|
|
||||||
Notification::new()
|
|
||||||
.summary(title)
|
|
||||||
.body(message)
|
|
||||||
.auto_icon()
|
|
||||||
.appname("bRAC")
|
|
||||||
.timeout(Timeout::Default) // this however is
|
|
||||||
.show()
|
|
||||||
.expect("notify-rust send error");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "libnotify")]
|
#[cfg(feature = "libnotify")]
|
||||||
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
|
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
|
||||||
use libnotify::Notification;
|
use libnotify::Notification;
|
||||||
@ -900,7 +885,7 @@ fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str)
|
|||||||
ui.notifications.write().unwrap().push(notification);
|
ui.notifications.write().unwrap().push(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(not(feature = "libnotify"), not(feature = "notify-rust")))]
|
#[cfg(not(feature = "libnotify"))]
|
||||||
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
|
fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str) {
|
||||||
use std::{
|
use std::{
|
||||||
hash::{DefaultHasher, Hasher},
|
hash::{DefaultHasher, Hasher},
|
||||||
@ -930,13 +915,7 @@ fn send_notification(_: Arc<Context>, ui: &UiModel, title: &str, message: &str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String, notify: bool) {
|
fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String, notify: bool) {
|
||||||
let formatting_enabled = ctx.config(|c| c.formatting_enabled);
|
let Some(message) = sanitize_message(message) else {
|
||||||
|
|
||||||
let Some(message) = (if formatting_enabled {
|
|
||||||
sanitize_message(message)
|
|
||||||
} else {
|
|
||||||
Some(message)
|
|
||||||
}) else {
|
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -954,9 +933,7 @@ fn on_add_message(ctx: Arc<Context>, ui: &UiModel, message: String, notify: bool
|
|||||||
|
|
||||||
let mut label = String::new();
|
let mut label = String::new();
|
||||||
|
|
||||||
if let (true, Some((date, ip, content, nick))) =
|
if let Some((date, ip, content, nick)) = parse_message(message.clone()) {
|
||||||
(formatting_enabled, parse_message(message.clone()))
|
|
||||||
{
|
|
||||||
if let Some(ip) = ip {
|
if let Some(ip) = ip {
|
||||||
if ctx.config(|o| o.show_other_ip) {
|
if ctx.config(|o| o.show_other_ip) {
|
||||||
label.push_str(&format!(
|
label.push_str(&format!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user