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:
- Public Overrides Function CreateDataManagerInstance(ByVal portal As AppPortal) As AppDataManager
- Return New myCreateDataManagerInstance(portal)
- 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:
- Public Overrides Function GetContacts(ByVal identity As ChatIdentity) As IChatUserInfo()
- Dim loginname As String = ChatProvider.Instance.FromUserId(identity.UniqueId)
-
- If loginname = "" then
- Return Nothing
- End if
-
- Dim friends() as string = myDATABASE.getcontacts(loginname)
-
- Dim arr(friends.Length - 1) As IChatUserInfo
-
- For i = 0 To friends.Length - 1
- Dim friendid as string = ChatProvider.Instance.ToUserId(friends(i))
- arr(i) = MyBase.GetUserInfo(friendid)
- Next
-
- Return arr
- 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.