Trying to add "Add Contact" feature on my asp/vb .net forum

Last post 02-20-2010, 7:38 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  02-11-2010, 3:20 PM 58672

    Trying to add "Add Contact" feature on my asp/vb .net forum

    Hi all,
     
    i was wondering if anyone knew how to make a button for a site (more specifically, for my forum) which allows me to add a contact to my contact list. I currently have the following:
    1. Imports CuteSoft.Chat  
    2.   
    3. Partial Class Support_addbuddy  
    4.     Inherits System.Web.UI.Page  
    5.   
    6.     Private Sub Page_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load  
    7.          
    8.         'Code for adding the author for the current message as IM contact  
    9.         If Request.QueryString("memberID") <> Request.QueryString("BuddyID"Then  
    10.   
    11.             Dim senderID As Int32 = UserInfoHelper.GetCuteIMUserObjectIDByProgramUserID(Request.QueryString("memberID"))  
    12.             Dim buddyID As Int32 = UserInfoHelper.GetCuteIMUserObjectIDByProgramUserID(Request.QueryString("buddyID"))  
    13.             Dim senderChatUserID As Int32 = UserInfoHelper.GetCuteChatUserIDByCuteIMObjectID(senderID)  
    14.             Dim buddyChatUserID As Int32 = UserInfoHelper.GetCuteChatUserIDByCuteIMObjectID(buddyID)  
    15.             Try  
    16.                 ChatApi.AddContact(senderChatUserID, buddyChatUserID)  
    17.                 ChatApi.SyncContacts(senderID, True)  
    18.                 ChatApi.SyncContacts(buddyID, True)  
    19.   
    20.             Catch ex As Exception  
    21.                 ReportError(ex)  
    22.             End Try  
    23.         End If  
    24.   
    25.     End Sub  
    26.   
    27. End Class 
    For some reason it doesn't work. Please advise.
     
    Thanks!

    Filed under: , , ,
  •  02-20-2010, 7:38 PM 58864 in reply to 58672

    Re: Trying to add "Add Contact" feature on my asp/vb .net forum

    Hi vince11111,
     
    Below is an example to show you  how to add user "terry" into friend list of ken.
    1. Dim portal As CuteChat.ChatPortal = CuteChat.ChatSystem.Instance.GetCurrentPortal()    
    2. SyncLock portal    
    3.     Dim myid As CuteChat.ChatIdentity = New CuteChat.AppChatIdentity("nickname"False"User:ken""0.0.0.0")    
    4.     portal.DataManager.AddContact(myid, "User:terry")    
    5. End SyncLock   

    Regards,
     
    Ken
View as RSS news feed in XML