Re: add users manually,

  •  07-28-2009, 2:25 AM

    Re: add users manually,

    Hi,
     
    I decided to start a chatsystem so I can add users using the following code
     
    1. Dim identity as CuteChat.ChatIdentity =new CuteChat.AppChatIdentity(MyUserName , false, "User:" & MyUserName, httpcontext.current.Request.UserHostAddress)    
    2. Dim identity2 as CuteChat.ChatIdentity =new CuteChat.AppChatIdentity(FriendUserName , false, "User:" & FriendUserName , httpcontext.current.Request.UserHostAddress)    
    3. If not CuteChat.ChatSystem.HasStarted then   
    4.   CuteChat.ChatProvider.Instance = New SiennChatProvider()   
    5.   CuteChat.ChatSystem.Start(New CuteChat.AppSystem())   
    6.   CuteChat.ChatSystem.Instance.GetCurrentPortal().DataManager.AddContact(identity, "User:" & FriendUserName)   
    7.   CuteChat.ChatSystem.Instance.GetCurrentPortal().DataManager.AddContact(identity2, "User:" & MyUserName)   
    8.   CuteChat.ChatSystem.Stop()   
    9. else   
    10.   CuteChat.ChatSystem.Instance.GetCurrentPortal().DataManager.AddContact(identity, "User:" & FriendUserName)   
    11.   CuteChat.ChatSystem.Instance.GetCurrentPortal().DataManager.AddContact(identity2, "User:" & MyUserName)   
    12. end if  
    Now the users are add in the buildincontacts of each other.
    But when I open de cutechat the user is nog added and still I can see him in the buildincontacts in de DB.
    When I close the messenger the user will be deleted from buildincontacts.
     
    I can't figure out when the chatsystem loads his contacts but for some reason i don't think it is while starting the client.
     
View Complete Thread