fixing call issues related to unset federated host

This commit is contained in:
Roland Osborne 2023-05-22 15:42:41 -07:00
parent 0251ea7dca
commit 9d6a7a91ba
3 changed files with 18 additions and 5 deletions

View File

@ -35,7 +35,18 @@ export function Session() {
incoming.push(
<div className="ringing-entry">
<Logo url={ring.img} width={40} height={40} radius={4} />
<div className="ringing-name">{ label }</div>
{ ring.name && (
<div className="ringing-name">{ ring.name }</div>
)}
{ !ring.name && ring.node && (
<div className="ringing-name">
<div>{ ring.handle }</div>
<div>{ ring.node }</div>
</div>
)}
{ !ring.name && !ring.node && (
<div className="ringing-name">{ ring.handle }</div>
)}
<div onClick={() => actions.ignore(ring)} className="ringing-ignore"><EyeInvisibleOutlined /></div>
<div onClick={() => actions.decline(ring)} className="ringing-decline"><PhoneOutlined /></div>
<div onClick={() => actions.accept(ring)} className="ringing-accept"><PhoneOutlined /></div>

View File

@ -188,7 +188,7 @@ export function useConversation(cardId, channelId) {
item.nameSet = true;
}
else {
item.name = `${identity.handle}@${identity.node}`;
item.name = identity.node ? `${identity.handle}@${identity.node}` : identity.handle ? identity.handle : 'unknown';
item.nameSet = false;
}
}
@ -202,7 +202,7 @@ export function useConversation(cardId, channelId) {
item.nameSet = true;
}
else {
item.name = `${contact.handle}@${contact.node}`;
item.name = contact.node ? `${contact.handle}@${contact.node}` : contact.handle ? contact.handle : 'unknown';
item.nameSet = false;
}
}

View File

@ -164,11 +164,13 @@ export function useSession() {
},
decline: async (call) => {
const { cardId, contactNode, contactToken, callId } = call;
await ring.actions.decline(cardId, contactNode, contactToken, callId);
const node = contactNode ? contactNode : window.location.host;
await ring.actions.decline(cardId, node, contactToken, callId);
},
accept: async (call) => {
const { cardId, callId, contactNode, contactToken, calleeToken, iceUrl, iceUsername, icePassword } = call;
await ring.actions.accept(cardId, callId, contactNode, contactToken, calleeToken, iceUrl, iceUsername, icePassword);
const node = contactNode ? contactNode : window.location.host;
await ring.actions.accept(cardId, callId, node, contactToken, calleeToken, iceUrl, iceUsername, icePassword);
},
end: async () => {
await ring.actions.end();