Class FriendList
This object representing a list of Friend.
You can use it to store contacts locally or synchronize them through CardDAV protocol.
Inherited Members
Namespace: Linphone
Assembly: cs.temp.dll.dll
Syntax
public class FriendList : LinphoneObject
Properties
Core
Returns the Core object attached to this LinphoneFriendList.
Declaration
public Core Core { get; }
Property Value
Type | Description |
---|---|
Core | a Core object |
CurrentCallbacks
Get the current LinphoneFriendListCbs object associated with a LinphoneFriendList.
Declaration
public FriendListListener CurrentCallbacks { get; }
Property Value
Type | Description |
---|---|
FriendListListener | The current LinphoneFriendListCbs object associated with the LinphoneFriendList. |
DisplayName
Get the display name of the friend list.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The display name of the friend list. |
Friends
Retrieves the list of Friend from this LinphoneFriendList.
Declaration
public IEnumerable<Friend> Friends { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Friend> | A list of Friend |
IsSubscriptionBodyless
Get wheter the subscription of the friend list is bodyless or not.
Declaration
public bool IsSubscriptionBodyless { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Wheter the subscription of the friend list is bodyless or not. |
Listener
Declaration
public FriendListListener Listener { get; }
Property Value
Type | Description |
---|---|
FriendListListener |
RlsAddress
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
Declaration
public Address RlsAddress { get; set; }
Property Value
Type | Description |
---|---|
Address | The RLS URI as Address associated with the friend list. |
RlsUri
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
Declaration
public string RlsUri { get; set; }
Property Value
Type | Description |
---|---|
System.String | The RLS URI associated with the friend list. |
SubscriptionBodyless
Set wheter the subscription of the friend list is bodyless or not.
Declaration
public bool SubscriptionBodyless { set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SubscriptionsEnabled
Gets whether subscription to NOTIFYes of all friends list are enabled or not.
Declaration
public bool SubscriptionsEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Whether subscriptions are enabled or not |
Uri
Get the URI associated with the friend list.
Declaration
public string Uri { get; set; }
Property Value
Type | Description |
---|---|
System.String | The URI associated with the friend list. |
Methods
AddFriend(Friend)
Add a friend to a friend list.
If or when a remote CardDAV server will be attached to the list, the friend will be sent to the server.
Declaration
public FriendListStatus AddFriend(Friend linphoneFriend)
Parameters
Type | Name | Description |
---|---|---|
Friend | linphoneFriend | Friend object to add to the friend list. |
Returns
Type | Description |
---|---|
FriendListStatus | OK if successfully added, InvalidFriend if the friend is not valid. |
AddLocalFriend(Friend)
Add a friend to a friend list.
The friend will never be sent to a remote CardDAV server. Warning! #LinphoneFriends added this way will be removed on the next synchronization, and the callback contact_deleted will be called.
Declaration
public FriendListStatus AddLocalFriend(Friend linphoneFriend)
Parameters
Type | Name | Description |
---|---|---|
Friend | linphoneFriend | Friend object to add to the friend list. |
Returns
Type | Description |
---|---|
FriendListStatus | OK if successfully added, InvalidFriend if the friend is not valid. |
ExportFriendsAsVcard4File(String)
Creates and export Friend objects from FriendList to a file using vCard 4 format.
Declaration
public void ExportFriendsAsVcard4File(string vcardFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | vcardFile | the path to a file that will contain the vCards |
Finalize()
Declaration
protected void Finalize()
FindFriendByAddress(Address)
Find a friend in the friend list using a LinphoneAddress.
Declaration
public Friend FindFriendByAddress(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | Address object of the friend we want to search for. |
Returns
Type | Description |
---|---|
Friend | A Friend if found, null otherwise. |
FindFriendByPhoneNumber(String)
Find a friend in the friend list using a phone number.
Declaration
public Friend FindFriendByPhoneNumber(string phoneNumber)
Parameters
Type | Name | Description |
---|---|---|
System.String | phoneNumber | a string of the phone number for which we want to find a friend. |
Returns
Type | Description |
---|---|
Friend | A Friend if found, null otherwise. |
FindFriendByRefKey(String)
Find a friend in the friend list using a ref key.
Declaration
public Friend FindFriendByRefKey(string refKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | refKey | The ref key string of the friend we want to search for. |
Returns
Type | Description |
---|---|
Friend | A Friend if found, null otherwise. |
FindFriendByUri(String)
Find a friend in the friend list using an URI string.
Declaration
public Friend FindFriendByUri(string uri)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | A string containing the URI of the friend we want to search for. |
Returns
Type | Description |
---|---|
Friend | A Friend if found, null otherwise. |
FindFriendsByAddress(Address)
Find all friends in the friend list using a LinphoneAddress.
Declaration
public IEnumerable<Friend> FindFriendsByAddress(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | Address object of the friends we want to search for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Friend> | A list of Friend if found, null otherwise. |
FindFriendsByUri(String)
Find all friends in the friend list using an URI string.
Declaration
public IEnumerable<Friend> FindFriendsByUri(string uri)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | A string containing the URI of the friends we want to search for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Friend> | A list of Friend if found, null otherwise. |
ImportFriendsFromVcard4Buffer(String)
Creates and adds Friend objects to FriendList from a buffer that contains the vCard(s) to parse.
Declaration
public int ImportFriendsFromVcard4Buffer(string vcardBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.String | vcardBuffer | the buffer that contains the vCard(s) to parse |
Returns
Type | Description |
---|---|
System.Int32 | the amount of linphone friends created |
ImportFriendsFromVcard4File(String)
Creates and adds Friend objects to FriendList from a file that contains the vCard(s) to parse.
Declaration
public int ImportFriendsFromVcard4File(string vcardFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | vcardFile | the path to a file that contains the vCard(s) to parse |
Returns
Type | Description |
---|---|
System.Int32 | the amount of linphone friends created |
NotifyPresence(PresenceModel)
Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS).
Declaration
public void NotifyPresence(PresenceModel presence)
Parameters
Type | Name | Description |
---|---|---|
PresenceModel | presence | PresenceModel object. |
RemoveFriend(Friend)
Remove a friend from a friend list.
Declaration
public FriendListStatus RemoveFriend(Friend linphoneFriend)
Parameters
Type | Name | Description |
---|---|---|
Friend | linphoneFriend | Friend object to remove from the friend list. |
Returns
Type | Description |
---|---|
FriendListStatus | OK if removed successfully, NonExistentFriend if the friend is not in the list. |
SynchronizeFriendsFromServer()
Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri.
Declaration
public void SynchronizeFriendsFromServer()
UpdateDirtyFriends()
Goes through all the Friend that are dirty and does a CardDAV PUT to update the server.
Declaration
public void UpdateDirtyFriends()
UpdateRevision(Int32)
Sets the revision from the last synchronization.
Declaration
public void UpdateRevision(int revision)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | revision | The revision |
UpdateSubscriptions()
Update presence subscriptions for the entire list.
Calling this function is necessary when list subscriptions are enabled, ie when a RLS presence server is used.
Declaration
public void UpdateSubscriptions()