mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
refactor(essentials): Switches from zoom specific contact class to generic InvitableDirectoryContact class
This commit is contained in:
@@ -160,7 +160,19 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IInvitableContact
|
public interface IInvitableContact
|
||||||
{
|
{
|
||||||
|
bool IsInvitableContact { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class InvitableDirectoryContact : DirectoryContact, IInvitableContact
|
||||||
|
{
|
||||||
|
[JsonProperty("isInvitableContact")]
|
||||||
|
public bool IsInvitableContact
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this is IInvitableContact;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -209,15 +221,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
[JsonProperty("title")]
|
[JsonProperty("title")]
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
[JsonProperty("isInvitableContact")]
|
|
||||||
public bool IsInvitableContact
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this is IInvitableContact;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("contactMethods")]
|
[JsonProperty("contactMethods")]
|
||||||
public List<ContactMethod> ContactMethods { get; set; }
|
public List<ContactMethod> ContactMethods { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -236,14 +236,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Used to be able to inplement IInvitableContact on DirectoryContact
|
|
||||||
/// </summary>
|
|
||||||
public class ZoomDirectoryContact : DirectoryContact, IInvitableContact
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Phonebook
|
public class Phonebook
|
||||||
{
|
{
|
||||||
[JsonProperty("Contacts")]
|
[JsonProperty("Contacts")]
|
||||||
@@ -302,7 +294,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
foreach (Contact c in zoomContacts)
|
foreach (Contact c in zoomContacts)
|
||||||
{
|
{
|
||||||
var contact = new ZoomDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
||||||
|
|
||||||
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
|
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
|
||||||
|
|
||||||
|
|||||||
@@ -2077,7 +2077,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
/// <param name="contact"></param>
|
/// <param name="contact"></param>
|
||||||
public override void Dial(IInvitableContact contact)
|
public override void Dial(IInvitableContact contact)
|
||||||
{
|
{
|
||||||
var ic = contact as zStatus.ZoomDirectoryContact;
|
var ic = contact as InvitableDirectoryContact;
|
||||||
|
|
||||||
if (ic != null)
|
if (ic != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user