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

Unable to join private group conversation #852

Closed
bemoody opened this issue Aug 20, 2021 · 6 comments
Closed

Unable to join private group conversation #852

bemoody opened this issue Aug 20, 2021 · 6 comments

Comments

@bemoody
Copy link
Contributor

bemoody commented Aug 20, 2021

I received an email saying that I was mentioned in a private group conversation ("mpdm-alice--bmoody--bob-1", I guess, is the internal identifier.)

When I open weechat, there is no buffer for this conversation. (I guess that this is due to issues #551 and/or 780).

However, when I type /slack talk alice,bob, nothing happens. No buffer is created and there is no error message.

It appears that I can create new conversations with different sets of people, but for some reason I cannot join a conversation that already exists.

@trygveaa
Copy link
Member

Which version/commit of wee-slack are you running?

Try to enable debug mode and see if there are any messages in the core or debug buffer when you run the command.

@bemoody
Copy link
Contributor Author

bemoody commented Aug 20, 2021

I'm using commit 64a4395 (master as of June 24).

Here's an example of the debug messages I see when I try to join an existing group (don't know if all of these are related):

15:57:19 | DEBUG: Sent {"type": "typing", "id": 5, "channel": "D0*********"}...
15:57:21 | DEBUG: RECEIVED FROM QUEUE
15:57:21 | DEBUG: stored context 86************************************** https://api.slack.com/api/conversations.open?token=xoxp-29********-*************-*************-********************************&users=U0*********%2CW0*********%2CW0*********
15:57:22 | DEBUG: RECEIVED CALLBACK with request of conversations.open id of 08************************************** and  code 0 of length 1018
15:57:22 | DEBUG: RECEIVED FROM QUEUE
15:57:22 | DEBUG: SET FROM META
15:57:22 | DEBUG: running conversationsopen
15:57:37 | DEBUG: RECEIVED FROM QUEUE
15:57:37 | DEBUG: SET FROM type
15:57:37 | DEBUG: running presence_change
15:58:11 | DEBUG: RECEIVED FROM QUEUE
15:58:12 | DEBUG: SET FROM type
15:58:12 | DEBUG: running presence_change
15:59:38 | DEBUG: RECEIVED FROM QUEUE
15:59:38 | DEBUG: SET FROM type
15:59:38 | DEBUG: running dnd_updated_user
15:59:38 | DEBUG: Callback not implemented for event: dnd_updated_user
15:59:42 | DEBUG: RECEIVED FROM QUEUE
15:59:43 | DEBUG: SET FROM type
15:59:43 | DEBUG: running dnd_updated_user
15:59:43 | DEBUG: Callback not implemented for event: dnd_updated_user

In contrast, when I try to join a group that never existed before, the stored context message is followed immediately by RECEIVED FROM QUEUE, SET FROM type, and running mpim_joined, followed by many more messages.

@trygveaa
Copy link
Member

So nothing is printed to the core buffer?

Can you post the content that https://api.slack.com/api/conversations.open?token=xoxp-29********-*************-*************-********************************&users=U0*********%2CW0*********%2CW0********* returns? That is the url that is printed in the debug buffer when you run a /slack talk command that is not working.

@bemoody
Copy link
Contributor Author

bemoody commented Aug 20, 2021

No, nothing shows up in the core buffer. (I do actually see an error message python: wrong arguments for function "string_remove_color" (script: slack), but that happens at startup and seems unrelated.)

Here's an example of the response when the talk command is unsuccessful:

{"ok":true,"channel":{"id":"C0*********","name":"mpdm-********--******--**********-1","is_channel":true,"is_group":false,"is_im":false,"created":1628180418,"is_archived":false,"is_general":false,"unlinked":0,"name_normalized":"mpdm-********--******--**********-1","is_shared":true,"parent_conversation":null,"creator":"U0*********","is_read_only":false,"is_thread_only":false,"is_non_threadable":false,"is_moved":0,"is_ext_shared":false,"enterprise_id":"E0*********","is_global_shared":false,"is_org_default":false,"is_org_mandatory":false,"is_org_shared":true,"shared_team_ids":[],"internal_team_ids":[],"connected_team_ids":[],"connected_limited_team_ids":[],"pending_shared":[],"pending_connected_team_ids":[],"is_pending_ext_shared":false,"is_member":true,"is_private":true,"is_mpim":true,"last_read":"0000000000.000000","is_open":true,"topic":{"value":"","creator":"","last_set":0},"purpose":{"value":"Group messaging with: @******** @****** @**********","creator":"U0*********","last_set":1628180418},"priority":0.0082929473396317}}

If the response is different when it's successful, I don't know an easy way to find that out, because it's only successful the first time (and the URL is the same each time.)

@bemoody
Copy link
Contributor Author

bemoody commented Sep 7, 2021

Following kludge seems to allow joining conversations with /slack talk user1,user2:

--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3730,6 +3731,16 @@ def handle_conversationsopen(
             "unread_count_display", 0
         )
         channel.set_unread_count_display(unread_count_display)
+    else:
+        # channel doesn't exist
+        try:
+            is_mpim = conversation_json['channel']['is_mpim']
+        except KeyError:
+            is_mpim = False
+        if is_mpim:
+            process_mpim_joined(
+                conversation_json, eventrouter, team, channel, metadata
+            )
 
 

I'm sure there is a better way to do this.

Of course this still doesn't create the buffer automatically, you need to manually invoke /slack talk with the usernames of all the people in the conversation.

@trygveaa
Copy link
Member

This should be fixed now. Both that the buffer is not shown when you start WeeChat, and that /slack talk alice,bob doesn't work.

Please comment or open a new issue if you still experience issues.

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