Skip to content

Commit

Permalink
Add pronouns to Jitsi and Zoom calls (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Feb 6, 2022
1 parent 9f2b67c commit 80b4dcf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions client/Name.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ export Pronouns = React.memo ->
</Card.Body>
</Card>
Pronouns.displayName = 'Pronouns'

export concatNamePronouns = (name, pronouns) ->
name += " (#{pronouns})" if pronouns
name
export useNameWithPronouns = ->
concatNamePronouns useName(), usePronouns()
export getNameWithPronouns = ->
concatNamePronouns getName(), getPronouns()
4 changes: 2 additions & 2 deletions client/TabJitsi.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import useScript from 'react-script-hook'
import {Alert, Button, Card} from 'react-bootstrap'

import {Loading} from './Loading'
import {useName} from './Name'
import {useNameWithPronouns} from './Name'
import {getDark} from './Settings'
import {Tabs} from '/lib/tabs'

Expand Down Expand Up @@ -41,7 +41,7 @@ export TabJitsi = React.memo ({tabId, room}) ->
ref = useRef() # div container for Jitsi iframe
[joined, setJoined] = useState lastJitsiStatus.joined # joined call?
[api, setApi] = useState() # JitsiMeetExternalAPI object
name = useName()
name = useNameWithPronouns()

## Jitsi API
useEffect ->
Expand Down
6 changes: 3 additions & 3 deletions client/TabZoom.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useTracker} from 'meteor/react-meteor-data'
import {Alert, Button, Card, Row, Col} from 'react-bootstrap'

import {allow} from './TabIFrame'
import {getName} from './Name'
import {getNameWithPronouns} from './Name'
import {Tabs, zoomRegExp} from '/lib/tabs'
import {meteorCallPromise} from '/lib/meteorPromise'

Expand Down Expand Up @@ -35,7 +35,7 @@ export TabZoom = React.memo ({tabId}) ->
prefix = if ua.getDevice().type == 'mobile' then 'zoomus' else 'zoommtg'
url = "#{prefix}://zoom.us/join?confno=#{zoomID}"
url += "&pwd=#{zoomPwd}" if zoomPwd
name = getName()
name = getNameWithPronouns()
url += "&uname=#{encodeURIComponent name}" if name
window.location.replace url

Expand All @@ -47,7 +47,7 @@ export TabZoom = React.memo ({tabId}) ->
[embedUrl, setEmbedUrl] = useState()
zoomWeb = ->
{signature, apiKey} = await meteorCallPromise 'zoomSign', zoomID
setEmbedUrl "/zoom.html?name=#{base64 getName() ? ''}&mn=#{zoomID}&email=&pwd=#{zoomPwd ? ''}&role=0&lang=en-US&signature=#{signature}&china=0&apiKey=#{apiKey}"
setEmbedUrl "/zoom.html?name=#{base64 getNameWithPronouns() ? ''}&mn=#{zoomID}&email=&pwd=#{zoomPwd ? ''}&role=0&lang=en-US&signature=#{signature}&china=0&apiKey=#{apiKey}"
return <iframe src={embedUrl} allow={allow}/> if embedUrl

<Card>
Expand Down

0 comments on commit 80b4dcf

Please sign in to comment.