Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 8eee40a

Browse files
Revert "Updates Dispatch Conversation URLs to reflect complete workspace URL (#3449)" (#3522)
This reverts commit f4c720f. Co-authored-by: Marc Vilanova <39573146+mvilanova@users.noreply.github.com>
1 parent 7a92c4c commit 8eee40a

2 files changed

Lines changed: 3 additions & 20 deletions

File tree

src/dispatch/plugins/dispatch_slack/enums.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33

44
class SlackAPIGetEndpoints(DispatchEnum):
5-
chat_permalink = "chat.getPermalink"
65
conversations_history = "conversations.history"
76
conversations_info = "conversations.info"
8-
team_info = "team.info"
97
users_conversations = "users.conversations"
108
users_info = "users.info"
119
users_lookup_by_email = "users.lookupByEmail"

src/dispatch/plugins/dispatch_slack/service.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ def list_conversation_messages(client: WebClient, conversation_id: str, **kwargs
8686
)
8787

8888

89-
@functools.lru_cache()
90-
def get_domain(client: WebClient) -> str:
91-
"""Gets the team's Slack domain."""
92-
return make_call(client, SlackAPIGetEndpoints.team_info)["team"]["domain"]
93-
94-
9589
@functools.lru_cache()
9690
def get_user_info_by_id(client: WebClient, user_id: str) -> dict:
9791
"""Gets profile information about a user by id."""
@@ -194,7 +188,7 @@ def create_conversation(client: WebClient, name: str, is_private: bool = False)
194188
return {
195189
"id": response["id"],
196190
"name": response["name"],
197-
"weblink": f"https://{get_domain(client)}.slack.com/app_redirect?channel={response['id']}",
191+
"weblink": f"https://slack.com/app_redirect?channel={response['id']}",
198192
}
199193

200194

@@ -269,15 +263,6 @@ def add_users_to_conversation(
269263
pass
270264

271265

272-
def get_message_permalink(client: WebClient, conversation_id: str, ts: str) -> str:
273-
return make_call(
274-
client,
275-
SlackAPIGetEndpoints.chat_permalink,
276-
channel=conversation_id,
277-
message_ts=ts,
278-
)
279-
280-
281266
def send_message(
282267
client: WebClient,
283268
conversation_id: str,
@@ -302,7 +287,7 @@ def send_message(
302287
return {
303288
"id": response["channel"],
304289
"timestamp": response["ts"],
305-
"weblink": get_message_permalink(client, response["channel"], response["ts"]),
290+
"weblink": f"https://slack.com/app_redirect?channel={response['id']}", # TODO should we fetch the permalink?
306291
}
307292

308293

@@ -326,7 +311,7 @@ def update_message(
326311
return {
327312
"id": response["channel"],
328313
"timestamp": response["ts"],
329-
"weblink": get_message_permalink(client, response["channel"], response["ts"]),
314+
"weblink": f"https://slack.com/app_redirect?channel={response['id']}", # TODO should we fetch the permalink?
330315
}
331316

332317

0 commit comments

Comments
 (0)