You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-03 00:33:22 +03:00 
			
		
		
		
	Merge pull request #5366 from matrix-org/dbkr/call_hold
Implement call hold
This commit is contained in:
		@@ -46,6 +46,7 @@ import { EffectiveMembership, getEffectiveMembership, leaveRoomBehaviour } from
 | 
			
		||||
import SdkConfig from "./SdkConfig";
 | 
			
		||||
import SettingsStore from "./settings/SettingsStore";
 | 
			
		||||
import {UIFeature} from "./settings/UIFeature";
 | 
			
		||||
import CallHandler from "./CallHandler";
 | 
			
		||||
 | 
			
		||||
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
 | 
			
		||||
interface HTMLInputEvent extends Event {
 | 
			
		||||
@@ -1057,6 +1058,32 @@ export const Commands = [
 | 
			
		||||
        },
 | 
			
		||||
        category: CommandCategories.actions,
 | 
			
		||||
    }),
 | 
			
		||||
    new Command({
 | 
			
		||||
        command: "holdcall",
 | 
			
		||||
        description: _td("Places the call in the current room on hold"),
 | 
			
		||||
        category: CommandCategories.other,
 | 
			
		||||
        runFn: function(roomId, args) {
 | 
			
		||||
            const call = CallHandler.sharedInstance().getCallForRoom(roomId);
 | 
			
		||||
            if (!call) {
 | 
			
		||||
                return reject("No active call in this room");
 | 
			
		||||
            }
 | 
			
		||||
            call.setRemoteOnHold(true);
 | 
			
		||||
            return success();
 | 
			
		||||
        },
 | 
			
		||||
    }),
 | 
			
		||||
    new Command({
 | 
			
		||||
        command: "unholdcall",
 | 
			
		||||
        description: _td("Takes the call in the current room off hold"),
 | 
			
		||||
        category: CommandCategories.other,
 | 
			
		||||
        runFn: function(roomId, args) {
 | 
			
		||||
            const call = CallHandler.sharedInstance().getCallForRoom(roomId);
 | 
			
		||||
            if (!call) {
 | 
			
		||||
                return reject("No active call in this room");
 | 
			
		||||
            }
 | 
			
		||||
            call.setRemoteOnHold(false);
 | 
			
		||||
            return success();
 | 
			
		||||
        },
 | 
			
		||||
    }),
 | 
			
		||||
 | 
			
		||||
    // Command definitions for autocompletion ONLY:
 | 
			
		||||
    // /me is special because its not handled by SlashCommands.js and is instead done inside the Composer classes
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user