Class FriendList
This object representing a list of Linphone.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 Linphone.Core object attached to this LinphoneFriendList.
Declaration
public Core Core { get; }
Property Value
| Type | Description |
|---|---|
| Core | a Linphone.Core object |
DatabaseStorageEnabled
Gets whether this friend list and it's friends will be stored in DB or not.
Declaration
public bool DatabaseStorageEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Whether the list and it's friends will be saved in database or not |
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 Linphone.Friend from this LinphoneFriendList.
Declaration
public IEnumerable<Friend> Friends { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Friend> | A list of Linphone.Friend |
IsReadOnly
Gets whether this friend list is read only or not.
If it is, you won't be able to add/remove friends in/from it, nor to edit existing friends in it.
Declaration
public bool IsReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | true if this friend list is in read-only mode and thus can't be modified, false otherwise. |
IsSubscriptionBodyless
Get wether the subscription of the friend list is bodyless or not.
Declaration
public bool IsSubscriptionBodyless { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Wether the subscription of the friend list is bodyless or not. |
Listener
Declaration
public FriendListListener Listener { get; set; }
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 Linphone.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 wether 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 NOTIFYs are enabled or not.
Declaration
public bool SubscriptionsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Whether subscriptions are enabled or not |
Type
Get the Linphone.FriendListType of a friend list.
Declaration
public FriendListType Type { get; set; }
Property Value
| Type | Description |
|---|---|
| FriendListType |
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 | Linphone.Friend object to add to the friend list. |
Returns
| Type | Description |
|---|---|
| FriendListStatus | Linphone.FriendListStatus.OK if successfully added, Linphone.FriendListStatus.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! Linphone.Friend 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 | Linphone.Friend object to add to the friend list. |
Returns
| Type | Description |
|---|---|
| FriendListStatus | Linphone.FriendListStatus.OK if successfully added, Linphone.FriendListStatus.InvalidFriend if the friend is not valid. |
ExportFriendsAsVcard4File(String)
Creates and export Linphone.Friend objects from Linphone.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 |
FindFriendByAddress(Address)
Find a friend in the friend list using a LinphoneAddress.
Declaration
public Friend FindFriendByAddress(Address address)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | Linphone.Address object of the friend we want to search for. |
Returns
| Type | Description |
|---|---|
| Friend | A Linphone.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 Linphone.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 Linphone.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 Linphone.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 | Linphone.Address object of the friends we want to search for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Friend> | A list of Linphone.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 Linphone.Friend if found, null otherwise. |
ImportFriendsFromVcard4Buffer(String)
Creates and adds Linphone.Friend objects to Linphone.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 Linphone.Friend objects to Linphone.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 | Linphone.PresenceModel object. |
RemoveFriend(Friend)
Remove a friend from a friend list.
Declaration
public FriendListStatus RemoveFriend(Friend linphoneFriend)
Parameters
| Type | Name | Description |
|---|---|---|
| Friend | linphoneFriend | Linphone.Friend object to remove from the friend list. |
Returns
| Type | Description |
|---|---|
| FriendListStatus | Linphone.FriendListStatus.OK if removed successfully, Linphone.FriendListStatus.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()
SynchronizeFriendsWith(IEnumerable<Friend>)
Synchronize a local friendlist with another list of friends.
All friends in common will be updated using the data from the source friends. Missing friends from the source friends will be added. Extra friends from the local friendlist will be removed.
Declaration
public bool SynchronizeFriendsWith(IEnumerable<Friend> sourceFriends)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<Friend> | sourceFriends | the list of Linphone.Friend whose data will be copied. (not a Linphone.FriendList !) |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the friendlist has been modified, false if no change happened |
UpdateDirtyFriends()
Goes through all the Linphone.Friend that are dirty and does a CardDAV PUT to update the server.
Declaration
public void UpdateDirtyFriends()
UpdateRevision(String)
Sets the revision from the last synchronization.
Declaration
public void UpdateRevision(string revision)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | revision | The revision. |
Remarks
Warning : before 5.4.0 release revision was an int, it's now a string.
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()