Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sshchat fixes #675

Merged
merged 4 commits into from
Jan 5, 2019
Merged

Sshchat fixes #675

merged 4 commits into from
Jan 5, 2019

Conversation

ValdikSS
Copy link
Contributor

@ValdikSS ValdikSS commented Jan 5, 2019

The patchset fixes most annoying SSH-Chat problems.

@42wim 42wim merged commit 7326b9e into 42wim:master Jan 5, 2019
@42wim
Copy link
Owner

42wim commented Jan 5, 2019

Thanks!

@@ -33,7 +33,7 @@ func (b *Bsshchat) Connect() error {
b.r = bufio.NewScanner(r)
b.r.Scan()
b.w = w
if _, err := b.w.Write([]byte("/theme mono\r\n")); err != nil {
if _, err := b.w.Write([]byte("/theme mono\r\n/quiet\r\n")); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totes agree that "quiet" makes sense, @ValdikSS :) you're a hero

just want to flag for later (if interested) that quiet mode messages could perhaps also be dropped in the gateway by tagging these sshchat messages as msg.Event = config.EventJoinLeave on their way into the gateway from sshchat bridge :)

// ignoreEvent returns true if we need to ignore this event for the specified destination bridge.
func (gw *Gateway) ignoreEvent(event string, dest *bridge.Bridge) bool {
switch event {
case config.EventAvatarDownload:
// Avatar downloads are only relevant for telegram and mattermost for now
if dest.Protocol != "mattermost" && dest.Protocol != "telegram" {
return true
}
case config.EventJoinLeave:
// only relay join/part when configured
if !dest.GetBool("ShowJoinPart") {
return true
}
case config.EventTopicChange:
// only relay topic change when used in some way on other side
if dest.GetBool("ShowTopicChange") && dest.GetBool("SyncTopic") {
return true
}
}
return false
}

zeridon pushed a commit to zeridon/matterbridge that referenced this pull request Feb 12, 2020
* SSH-Chat: set quiet mode to filter joins/quits
* SSH-Chat: Trim newlines in the end of relayed messages
* SSH-Chat: fix media links
* SSH-Chat: do not relay "Rate limiting is in effect" message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants