Skip to content

Commit

Permalink
pass desktop version to create call route
Browse files Browse the repository at this point in the history
Changelog: added
  • Loading branch information
antonbuks committed Jun 7, 2024
1 parent 7383113 commit 15b83c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion webapp/channels/src/actions/calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,12 @@ export function startOrJoinCallInChannelV2(channelID: string) {
return async (dispatch: DispatchFunc, getState: () => GlobalState) => {
const state = getState();
try {
const data = await Client4.startMeet(channelID);
let version;

if (isDesktopApp()) {
version = getDesktopVersion();
}
const data = await Client4.startMeet(channelID, version);
const channel = getChannel(state, channelID);

dispatch({
Expand Down
9 changes: 7 additions & 2 deletions webapp/platform/client/src/client4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4419,7 +4419,12 @@ export default class Client4 {
);
}

startMeet = (channelID: string) => {
startMeet = (channelID: string, version?: string) => {
let headers = {}
if (version) {
headers = {'Desktop-Version': version};
}

return this.doFetch<{
channel_id: string;
created_at: string;
Expand All @@ -4432,7 +4437,7 @@ export default class Client4 {
name: string;
}>(
`${this.getBaseRoute()}/conferences`,
{method: 'post', body: JSON.stringify({channel_id: channelID})},
{method: 'post', body: JSON.stringify({channel_id: channelID}), headers},
);
}
cancelMeet = (callID: string) => {
Expand Down

0 comments on commit 15b83c1

Please sign in to comment.