Help - Search - Members - Calendar
Full Version: How to add friends?
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
neoknights_
Hi

I finished searchforusers...

But i don't add firends...

Help me plz...
TheUberOverlord
[quote=neoknights]Hi

I finished searchforusers...

But i don't add firends...

Help me plz...[/quote]

Could you please show an example of the code?
neoknights_
an exmple

Set m_skype = CreateObject("SKYPE4COM.Skype")
Set search_user = m_skype.SearchForUsers(txtcontact.Text)

For Each Users In search_user
Set vItem = lvwcontact.ListItems.Add(, , Users.FullName)
vItem.SubItems(1) = Users.Handle
vItem.SubItems(2) = Users.Country
vItem.SubItems(3) = Users.City
vItem.SubItems(4) = Users.Language
Next
...................................................................

....I search Skype users

I want add friend on my friends list.....

But i don't add firend....

friends.add <--- Isn't it right to use this method?

Help me plz...
TheUberOverlord
[quote=neoknights]an exmple

Set m_skype = CreateObject("SKYPE4COM.Skype")
Set search_user = m_skype.SearchForUsers(txtcontact.Text)

For Each Users In search_user
Set vItem = lvwcontact.ListItems.Add(, , Users.FullName)
vItem.SubItems(1) = Users.Handle
vItem.SubItems(2) = Users.Country
vItem.SubItems(3) = Users.City
vItem.SubItems(4) = Users.Language
Next
...................................................................

....I search Skype users

I want add friend on my friends list.....

But i don't add firend....

friends.add <--- Isn't it right to use this method?

Help me plz...[/quote]

have you looked at this?

https://developer.skype.com/Docs/Skype4COML...rCollection#Add
neoknights_
I try this

But I don't use this....

I give up T T

Thanks for reply
edwardfeng_
Hi,
I am in the same problem, too.
There is my code:

void cSkypeControl::SKPAddToContent( CStringList & sUIDS )
{
POSITION pos;
CString sItem;

pos = sUIDS.GetHeadPosition();
sItem = sUIDS.GetNext( pos );

CUserCollection oMembers;

oMembers = m_pobjSkype->SearchForUsers( sItem );

long nCount;
nCount = oMembers.GetCount();
if ( nCount == 1 ) // find!!
{
CString sTemp;
CUser oUser;
oUser = oMembers.GetItem( 1 );

int nGroupCount;

nGroupCount = m_pobjSkype->GetGroups().GetCount();
m_pobjSkype->GetFriends().Add( oUser );

}
}
After "m_pobjSkype->GetFriends().Add( oUser );", i open the skype and try to find the new friend, but still not add in my friend list.
so, what is my fault?
unregistred_
[quote=neoknights]
Set vItem = lvwcontact.ListItems.Add(, , Users.FullName)
[/quote]
Please, explain me, what is the object Ivwcontact (of which class)?
Is it realy possible to add any user in contact list by Skype API?
andreskaasik_
New users can be added to contact list by changing the User object BuddyStatus property:

CODE


'// Create Skype object

Set oSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_")



'// To add user to contact list we must change user status to "Pending Authorization"

Const budPendingAuthorization = 2



'// Search for user not in contacts list

Set oFoundUsers = oSkype.SearchForUsers("skypeusername")



If oFoundUsers.Count = 1 Then



 '// Get the user object

 Set oUser = oFoundUsers.Item(1)

 

 '// Add user to contacts

 oUser.BuddyStatus = budPendingAuthorization

 

End If

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.