aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client/mod.rs51
1 files changed, 3 insertions, 48 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index f02f8e5..0199395 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -51,38 +51,9 @@ impl Client {
Ok(client)
}
- /// Send a raw `IrcMessage` to the server.
- pub fn send(&self, msg: IrcMessage) {
- self.sender.send(msg);
- }
-
- /// Send a PRIVMSG to a channel or user.
- pub fn privmsg(&self, target: &str, text: &str) {
- self.sender.send(IrcMessage::new(
- Command::Privmsg,
- vec![target.to_string(), text.to_string()],
- ));
- }
-
- /// Join a channel.
- pub fn join(&self, channel: &str) {
- self.sender
- .send(IrcMessage::new(Command::Join, vec![channel.to_string()]));
- }
-
- /// Part a channel.
- pub fn part(&self, channel: &str, reason: Option<&str>) {
- let mut params = vec![channel.to_string()];
- if let Some(r) = reason {
- params.push(r.to_string());
- }
- self.sender.send(IrcMessage::new(Command::Part, params));
- }
-
- /// Change nick.
- pub fn nick(&self, new_nick: &str) {
- self.sender
- .send(IrcMessage::new(Command::Nick, vec![new_nick.to_string()]));
+ /// Offer a clone of the sender
+ pub fn sender(&self) -> Sender {
+ self.sender.clone()
}
/// Read-only view of current client state.
@@ -137,19 +108,3 @@ impl Client {
));
}
}
-
-impl Client {
- /// Non-blocking version of `next_event`.
- /// Returns `Some(event)` if one is immediately available, `None` otherwise.
- /// Used by the TUI loop to drain events without blocking the render tick.
- pub fn next_event_nowait(&mut self) -> Option<Event> {
- loop {
- let msg = self.inbox.try_recv().ok()?;
- let mut events = handle(msg, &mut self.state, &self.sender);
-
- if !events.is_empty() {
- return Some(events.remove(0));
- }
- }
- }
-}
Add a comment about how the styles are iterated.Gravatar Christoph Lohmann 1-0/+4 Thanks quing for noticing. 2015-01-18My CMD was too short. :OGravatar Christoph Lohmann 1-1/+1 Thanks Carlos Torres for mentioning this. 2015-01-17Add the manpage changes for the disk cache support.Gravatar Christoph Lohmann 1-1/+7 2015-01-17Adding disk cache support for soup.Gravatar Christoph Lohmann 2-9/+40 This is a merge of the patch of Ben Woolley <tautolog@gmail.com> 2015-01-17Fix extra newline, and add -g where other switches are forwarded.Gravatar Ben Woolley 1-1/+3 Signed-off-by: Christoph Lohmann <20h@r-36.net> 2015-01-17Newer libc want _DEFAULT_SOURCE.Gravatar Christoph Lohmann 1-1/+1 2015-01-17Major styles update.Gravatar Christoph Lohmann 3-11/+84 In config.h there is now some styles array to apply site-specific styles. This can be toggled using the -mM flags. If a stylefile is manually specified, then this will overwrite everything. 2015-01-02Fix a typo in surf manual.Gravatar Jakukyo Friel 1-1/+1 `Ctrl-/` displays incorrectly in `man surf` on my machine. A patch is attached. (You also access it here: https://github.com/weakish/surf/commit/07e97eccedd96eabf14b2fbf77de75ec1b594d97) ---- surf.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Christoph Lohmann <20h@r-36.net> 2014-09-28Minor style change.Gravatar Christoph Lohmann 1-1/+1 2014-09-28Make »Copy image address« work.Gravatar Christoph Lohmann 1-3/+10 Thanks yui@blekksprut.net for the patch! 2014-08-07Mention xdotool in SEE ALSO too.Gravatar Christoph Lohmann 1-1/+2 2014-08-07Fix the manpage about xid.Gravatar Christoph Lohmann 1-1/+3 Something was missing from this one sentence. Now it is complete.