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

Support Calls #166

Closed
DanielSiepmann opened this issue Aug 26, 2022 · 5 comments
Closed

Support Calls #166

DanielSiepmann opened this issue Aug 26, 2022 · 5 comments

Comments

@DanielSiepmann
Copy link

Hi,

I've just started to use this plugin with pidgin and tried the video calls.
I would like to start a call and use calls within pidgin. But I would understand if that's to much.

Right now I receive an URL if someone starts a call, but the URL sems wrong. It is like https://workspace.slack.com/call/<call-id> but it seems they need to be like https://app.slack.com/free-willy/<im-id>/<call-id> where is the channel or user id.

I couldn't find anything related within the code and expect slack itself to send this url. Maybe we could transform this URL?

@DanielSiepmann
Copy link
Author

I've added a PR which converts the incoming broken URLs.
Next up would be a button to start a call, if possible. Not sure if I am able to do that.

@DanielSiepmann
Copy link
Author

I've started to read the plugin development how to as well as the source code.
Looks like a new custom command /call would to the job, which calculates the call URL from account and conversation and posts it via API. That way Slack web app and native clients will show a proper call while purple will retrieve the message and show the native link which could be opened within the browser.

I'll see whether I can implement that during the upcoming days.

@DanielSiepmann
Copy link
Author

Hey, @EionRobb can you help me out? I got it working but kept searching 2 hours to access the slack user id and can't find a way.

That's my current code which is working fine for group chats, but not for Ims as the obj->id is wrong. I need the one saved within the buddy within blist.xml but can't find a proper way to fetch this value. Any hints?

static PurpleCmdRet cmd_startcall(PurpleConversation *conv, const gchar *cmd, gchar **args, gchar **error, void *data) {
	SlackAccount *sa = get_slack_account(conv->account);
	if (!sa)
		return PURPLE_CMD_RET_FAILED;

	SlackObject *obj = slack_conversation_get_conversation(sa, conv);
	if (!obj) {
		return PURPLE_CMD_RET_FAILED;
	}

	// TODO: proper chat id for IMs
	// That's the one attached to the buddy as "slack"
	gchar *url = g_strconcat("https://app.slack.com/free-willy/", sa->team.id, "/", obj->id, NULL);
	slack_write_message(sa, obj, url, PURPLE_MESSAGE_SEND);
	g_free(url);

	return PURPLE_CMD_RET_OK;
}

@DanielSiepmann
Copy link
Author

Looks like all I was looking for was: slack_conversation_id(obj). PR incoming.

@DanielSiepmann
Copy link
Author

I'd say can be closed once the two related PRs got merged.

@dylex dylex closed this as completed in 387e6f1 Sep 1, 2022
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

1 participant