Skip to content

Commit

Permalink
Remove unsued config from Forwarder struct
Browse files Browse the repository at this point in the history
  • Loading branch information
exul committed Mar 30, 2017
1 parent 2ec0266 commit 8a461ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/matrix-rocketchat/handlers/events/forwarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ use ruma_events::room::message::{MessageEvent, MessageEventContent, TextMessageE
use slog::Logger;

use api::RocketchatApi;
use config::Config;
use db::{Room, UserOnRocketchatServer};
use errors::*;

/// Forwards messages
pub struct Forwarder<'a> {
config: &'a Config,
connection: &'a SqliteConnection,
logger: &'a Logger,
}

impl<'a> Forwarder<'a> {
/// Create a new `Forwarder`.
pub fn new(connection: &'a SqliteConnection, config: &'a Config, logger: &'a Logger) -> Forwarder<'a> {
pub fn new(connection: &'a SqliteConnection, logger: &'a Logger) -> Forwarder<'a> {
Forwarder {
config: config,
connection: connection,
logger: logger,
}
Expand Down
2 changes: 1 addition & 1 deletion src/matrix-rocketchat/handlers/events/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<'a> MessageHandler<'a> {
CommandHandler::new(self.config, self.connection, &self.logger, &self.matrix_api).process(event, room)?;
}
Some(ref room) => {
Forwarder::new(self.connection, &self.config, &self.logger).process(event, room)?;
Forwarder::new(self.connection, &self.logger).process(event, room)?;
}
None => debug!(self.logger, "Skipping event, because the room is not bridged"),
}
Expand Down

0 comments on commit 8a461ff

Please sign in to comment.