dylex / slack-libpurple

Slack module for libpurple
GNU General Public License v2.0
281 stars 41 forks source link

#general channel disappears from pidgin #40

Open kendrak24 opened 6 years ago

kendrak24 commented 6 years ago

I've seen this for the #general channel in our org, where is_general=true and (for some strange reason) is_member=false as seen in the debug snippet below. I've got no problem accessing this channel if I use Slack in a browser, and I'm in the member list (also checked in the browser). According to doc, everyone is implicitly a member of the #general channel, so maybe is_general just trumps is_member?

Debug snippet:

(10:43:30) slack: api response: {"ok":true,"channel":{"id":"XXXXXXXX","name":"general","is_channel":true,"created":1516374023,"is_archived":false,"is_general":true,"unlinked":0,"creator":"XXXXXXXX","name_normalized":"general","is_read_only":true,"is_shared":false,"is_org_shared":false,"is_member":false,"is_private":false,"is_mpim":false,"members":

Doc: The #general channel

bezirg commented 6 years ago

It happens for me as well. It seems to be triggered only in channels with too large membership (200+ members?), and usually general & random are very large because they are auto-joined. In slack projects with small membership, general and random channels work fine for me.

dylex commented 6 years ago

I still find it strange that is_member is false. What the API docs say is that "almost every user" is a member of general, not that is_general implies is_member. However, I'm happy to treat is_general as is_member if we think that's the right thing to do. It just means we won't additionally try to join the channel. I guess I'll do that and then you can let me know if it fixes it, or causes a different problem.

kendrak24 commented 6 years ago

@bezirg I had the theory that it had something to do with how the general channel was configured (read only vs not, etc). I created a dummy slack with a couple of members just to test this, but there the general channel worked fine (and both is_general and is_member was true) regardless how I configured the channel. So, roster size seems like a likely suspect. Since it all works fine in Slack's web client, I assume they're handling the general channel separately (or not using their own API).

@dylex The fix worked. At least for the general channel. We don't have a random channel, so I can't speak for that.

bezirg commented 6 years ago

The problem with general channel is fixed now for me.