Re: Using existing membership information + chat + Allow Anonymous= Error!!!

  •  12-02-2009, 2:31 AM

    Re: Using existing membership information + chat + Allow Anonymous= Error!!!

    Thanks for the reply!
     
    For my case it seems not to be as complicated as a locking or sync issue. Its just a method of return the right object when the login is anonymous.
     
    Here is my implementation:
     
    I've create two class that implements both the CuteChat.ChatProvider and AppDataManager.
     
    In my ChatProvider, it overrides the method CreateDataManagerInstance so that it will use my own DataManager:
    1. Public Overrides Function CreateDataManagerInstance(ByVal portal As AppPortal) As AppDataManager   
    2.     Return New myCreateDataManagerInstance(portal)   
    3. End Function  
    In my DataManager, it will implement the GetContacts and GetIgnores method.
    It works fine getting authenticated users, this is how it looks like:
    1. Public Overrides Function GetContacts(ByVal identity As ChatIdentity) As IChatUserInfo()   
    2.     Dim loginname As String = ChatProvider.Instance.FromUserId(identity.UniqueId)   
    3.        
    4.     If loginname = "" then   
    5.         Return Nothing  
    6.     End if   
    7.        
    8.     Dim friends() as string = myDATABASE.getcontacts(loginname)   
    9.   
    10.     Dim arr(friends.Length - 1) As IChatUserInfo   
    11.   
    12.     For i = 0 To friends.Length - 1   
    13.         Dim friendid as string = ChatProvider.Instance.ToUserId(friends(i))   
    14.         arr(i) = MyBase.GetUserInfo(friendid)   
    15.     Next  
    16.   
    17.     Return arr   
    18. End Function  
    The problem araise when its anonymous, the login name provided is a empty string and i've had to return "Nothing", it will cause the error.
     
    Please help.
     
View Complete Thread