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

Bitlbee auto_join problem #125

Open
edmcman opened this issue Jan 22, 2020 · 6 comments
Open

Bitlbee auto_join problem #125

edmcman opened this issue Jan 22, 2020 · 6 comments

Comments

@edmcman
Copy link

edmcman commented Jan 22, 2020

I'm encountering a pretty annoying bug when using bitlbee. When I have a Mattermost channel set to auto_join, bitlbee joins the channel, but no one is present besides me. If I /part and /join the channel, I join a slightly differently named room. For example, if the channel is #foo, I will be joined into #foo_. In the new room, the other users in the room are actually present.

If I turn off auto_join and manually join the channel, it works as expected. I think this might be a problem where bitlbee is joining the channel before Mattermost is ready.

I am happy to look into this a little more, but it's unclear if this is a bug in purple-mattermost or bitlbee itself. Do you have any insights?

@EionRobb
Copy link
Owner

I've seen this happen with other prpls if the "account connected" function is called before its possible to join

If you can get a purple debug log out of bitlbee it might shed a bit more light on what's happening

@edmcman
Copy link
Author

edmcman commented Jan 22, 2020

I have a debug log, but it has a lot of sensitive information, so I don't want to show it in its entirety. If there is something in particular that you think would be helpful to see I could extract it.

One thing I have noticed is that during the buggy behavior, there is not a call to purple_conversation_new, even though purple-mattermost calls serv_got_joined_chat. This makes me think it could be a bug in bitlbee. I'm very new to libpurple programming, so I'm trying to figure out how all this stuff works as I go!

@edmcman
Copy link
Author

edmcman commented Jan 22, 2020

Oops, nevermind about bitlbee. I think the problem is that there is no alias at https://github.com/EionRobb/purple-mattermost/blob/master/libmattermost.c#L3687

Since alias is NULL, purple_serv_got_joined_chat bails out.

It looks like normally the aliases are computed in mm_add_channels_to_blist, but maybe for the auto join channels this is too late?

@edmcman
Copy link
Author

edmcman commented Jan 22, 2020

Looks like we set the connection as connected at https://github.com/EionRobb/purple-mattermost/blob/master/libmattermost.c#L3687 which is when bitlbee starts the auto join process. But the channels are not created until mm_get_open_channels_for_team asynchronously completes.

@EionRobb
Copy link
Owner

Does it work ok if you move that "connected" to after the get-open-channels callback?

@edmcman
Copy link
Author

edmcman commented Jan 22, 2020

Yes. The PR in #126 fixes the problem for me. I think we need to have the counter though so we know when all get-open-channels are done.

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

No branches or pull requests

2 participants