Problems with Web Messenger

  •  02-05-2008, 4:30 AM

    Problems with Web Messenger

    I'm unable to integrate Web messenger successfully with my asp.net 2.0 Membership database.  I downloaded the software and copied it to my site, run the sql script and created the chat provider. However, the system is working inconsistently in both FF and IE: The problem is that, sometimes, when I open Web messenger, it does not retrieve my account, avatar and contacts, instead it shows my username as "My Name", default avatar, and my contacts are not populated.  This problem is intermittent because at times I'm able to connect successfully. I noticed also that if I change my status from "Online" to something else, then my username, avatar and description display correctly, but my contacts are not loaded.
     
    I appreciate with help in resolving these bug. I need to be confident that this system is bug-free before I deploy it to my members. I'm listing the code for my chat provider below. Please let me know if there are errors.  There is very little documentation for this system so I'm not sure that the code below is correct
      
     
    public class MMSChatProvider : CuteChat.ChatProvider
    {
        public MMSChatProvider()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public override string GetConnectionString()
        {
            //return the connection string , for the CuteChat
            return ConfigurationManager.ConnectionStrings["MMSDB"].ConnectionString;
        }

        public override string FindUserLoginName(string nickName)
        {
            ////find the login username from the display name or null if the user is not found.
            if (Membership.GetUser(nickName, false) == null)
                return null;
            else
                return nickName;
        }
        public override AppChatIdentity GetLogonIdentity()
        {
            //need to find the information of current user. Return null if user is anonymous.
            string loginname = HttpContext.Current.User.Identity.Name;
            return new AppChatIdentity(loginname, false, ToUserId(loginname), HttpContext.Current.Request.UserHostAddress);
        }
        public override bool GetUserInfo(string loginName, ref string nickName, ref bool isAdmin)
        {
           //return false , if the loginName is invalid.
           //otherwise set the nickName and isAdmin , and return ture
            if (Membership.GetUser(loginName, false) == null)
                return false;
            else
            {
                nickName = loginName;
                isAdmin = ("ADMINISTRATOR"==loginName.ToUpper());
                return true;
            }
        }
        public override bool ValidateUser(string loginName, string password)
        {
            //check the username/password .
            //if valid , set the cookie.
            // This function is for CuteLiveSupport only.
            return false;
        }

    }
    Filed under:
View Complete Thread