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

Join/Parts from Mumble #1435

Closed
s3m1s0n1c opened this issue Mar 28, 2021 · 6 comments
Closed

Join/Parts from Mumble #1435

s3m1s0n1c opened this issue Mar 28, 2021 · 6 comments
Labels
enhancement New feature or request mumble

Comments

@s3m1s0n1c
Copy link

Is it possible to add Join/Part messages from mumble to any bridge system?

Eg> From Mumble -> Telegram?

Thanks
Sonic

@s3m1s0n1c s3m1s0n1c added the enhancement New feature or request label Mar 28, 2021
@ghost
Copy link

ghost commented Mar 29, 2021

Would be awesome for this info to get passed through with ShowJoinPart=true like several other bridges.

@42wim 42wim added the mumble label Apr 3, 2021
@ghost
Copy link

ghost commented Apr 5, 2021

I was looking at the code that the IRC module uses:

func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) {
if len(event.Params) == 0 {
b.Log.Debugf("handleJoinPart: empty Params? %#v", event)
return
}
channel := strings.ToLower(event.Params[0])
if event.Command == "KICK" && event.Params[1] == b.Nick {
b.Log.Infof("Got kicked from %s by %s", channel, event.Source.Name)
time.Sleep(time.Duration(b.GetInt("RejoinDelay")) * time.Second)
b.Remote <- config.Message{Username: "system", Text: "rejoin", Channel: channel, Account: b.Account, Event: config.EventRejoinChannels}
return
}
if event.Command == "QUIT" {
if event.Source.Name == b.Nick && strings.Contains(event.Last(), "Ping timeout") {
b.Log.Infof("%s reconnecting ..", b.Account)
b.Remote <- config.Message{Username: "system", Text: "reconnect", Channel: channel, Account: b.Account, Event: config.EventFailure}
return
}
}
if event.Source.Name != b.Nick {
if b.GetBool("nosendjoinpart") {
return
}
msg := config.Message{Username: "system", Text: event.Source.Name + " " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave}
if b.GetBool("verbosejoinpart") {
b.Log.Debugf("<= Sending verbose JOIN_LEAVE event from %s to gateway", b.Account)
msg = config.Message{Username: "system", Text: event.Source.Name + " (" + event.Source.Ident + "@" + event.Source.Host + ") " + strings.ToLower(event.Command) + "s", Channel: channel, Account: b.Account, Event: config.EventJoinLeave}
} else {
b.Log.Debugf("<= Sending JOIN_LEAVE event from %s to gateway", b.Account)
}
b.Log.Debugf("<= Message is %#v", msg)
b.Remote <- msg
return
}
b.Log.Debugf("handle %#v", event)
}
func (b *Birc) handleNewConnection(client *girc.Client, event girc.Event) {
b.Log.Debug("Registering callbacks")
i := b.i
b.Nick = event.Params[0]
i.Handlers.Add("PRIVMSG", b.handlePrivMsg)
i.Handlers.Add("CTCP_ACTION", b.handlePrivMsg)
i.Handlers.Add(girc.RPL_TOPICWHOTIME, b.handleTopicWhoTime)
i.Handlers.Add(girc.NOTICE, b.handleNotice)
i.Handlers.Add("JOIN", b.handleJoinPart)
i.Handlers.Add("PART", b.handleJoinPart)
i.Handlers.Add("QUIT", b.handleJoinPart)
i.Handlers.Add("KICK", b.handleJoinPart)
i.Handlers.Add("INVITE", b.handleInvite)
}

Unfortunately, I don't think that would immediately translate for Mumble. Would have to be something a little more complex (and definitely different) written, I think. I don't really know/understand golang at all, though, so. 😢

@s3m1s0n1c
Copy link
Author

Yeah you would have to look @ gumble and see if u can get the same functions from it..

I had a quick look but couldn't make heads or tails of it..

@s3m1s0n1c
Copy link
Author

Boop

Any ideas?

I can't for the life of me work it out..

something to do with

func (b *Bmumble) handleDisconnect(event *gumble.DisconnectEvent) {

How do I sent to whatever bridge is active?

I'm trying to send it to telegram so I can see if a user joins/parts server/channel

@s3m1s0n1c
Copy link
Author

@s3lph Hey Man,

Any chance you can add so when someone join/parts mumble it notifies on Telegram?

Thanks
Sonic

s3lph added a commit to s3lph/matterbridge that referenced this issue Nov 6, 2022
@s3lph
Copy link
Contributor

s3lph commented Nov 6, 2022

Implemented in #1915.

I've only tested this between Mumble and IRC, not with Telegram. But since join/part messages are bridge-agnostic and are handled and forwarded by the gateway, this should work as long as the Telegram bridge can shows join/part messages at all.

@42wim 42wim closed this as completed in 6da9d56 Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mumble
Projects
None yet
Development

No branches or pull requests

3 participants