Users are appearing Offline in Cute Web Messenger

Last post 08-28-2009, 12:28 AM by Shaitender. 3 replies.
Sort Posts: Previous Next
  •  08-26-2009, 11:41 PM 55087

    Users are appearing Offline in Cute Web Messenger

    Hi Im using cute web messenger in my application.
     
    The problem which i'm facing is that when I add a user in the Contact list .Im able to add that user but despite the fact that user is online but it still shows that user is not online.
     
     
    Thanks in advance.
    Shaitender singh
     
  •  08-27-2009, 5:38 AM 55096 in reply to 55087

    Re: Users are not appearing online in Cute WebMessanger

    Hello guys,
     
    Help Needed urgently for the cute Web messanger above Issue
     
    Please Help...
     
     
     
  •  08-27-2009, 8:11 PM 55127 in reply to 55096

    Re: Users are not appearing online in Cute WebMessanger

    Hi,
     
    That often caused by wrong ChatProvider ?
     
    How do you install the software to website ?
     
    Regards,
    Terry
     
  •  08-28-2009, 12:28 AM 55133 in reply to 55127

    Re: Users are not appearing online in Cute WebMessanger

    Ok Terry, Can you check my chat provider and let me know where am i getting wrong.
     

      public override void Init()
            {
                base.Init();

                lock (typeof(CuteChat.ChatSystem))
                {
                    if (!CuteChat.ChatSystem.HasStarted)
                    {
                        CuteChat.ChatProvider.Instance = new MyChatProvider();
                        CuteChat.ChatSystem.Start(new CuteChat.AppSystem());
                     
                    }
                }
            }


     public class MyChatProvider : CuteChat.ChatProvider
            {
                /// <summary>
                /// Get connection string for Cute Chat
                /// </summary>
                /// <returns></returns>
                public override string GetConnectionString()
                {
                    return ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
                }

                /// <summary>
                /// Find a user and return its loign name from the display name or null if
                /// the user is not found
                /// </summary>
                /// <param name="nickName"></param>
                /// <returns></returns>
                public override string FindUserLoginName(string nickName)
                {
                    BL.Users.User user = Utilities.FindUser(nickName);  //nickName should be email here

                    if (user.UserID <= 0)
                        return null;
                    else
                        return user.Email;
                }

                /// <summary>
                /// Get the LogonIdentity for the current user
                /// to be used in Cute Chat
                /// </summary>
                /// <returns></returns>
                public override AppChatIdentity GetLogonIdentity()
                {
                  //need to find the information of current user. Return null if user is anonymous.
                  //string loginname=...
                  //string nickname=...
                  //return new AppChatIdentity(nickname, false, ToUserId(loginname), HttpContext.Current.Request.UserHostAddress);

                    UserContext userContext = UserContext.Get(HttpContext.Current.Session);
                    if (userContext.UserID <= 0)
                        return null;
                    return new AppChatIdentity(userContext.UserName, false, ToUserId(Utilities.GetUserEmail()),                                  HttpContext.Current.Request.UserHostAddress);
                }

                /// <summary>
                /// returns false if the loginName is invalid
                /// else set the nickName and isAdmin, and return true
                /// </summary>
                /// <param name="loginName"></param>
                /// <param name="nickName"></param>
                /// <param name="isAdmin"></param>
                /// <returns></returns>
                public override bool GetUserInfo(string loginName, ref string nickName, ref bool isAdmin)
                {
                    BL.Users.User user = Utilities.FindUser(loginName);
                    if (user.UserID <= 0)
                        return false;
                    nickName = user.UserName;
                    isAdmin = false;
                    return true;
                }

                /// <summary>
                /// Validate a chat user
                /// </summary>
                /// <param name="loginName"></param>
                /// <param name="password"></param>
                /// <returns></returns>
                public override bool ValidateUser(string loginName, string password)
                {
                    bool isLogin = false;
                    BL.Users.User user = new Axero.Dyve.BL.Users.User();
                    user.Email = loginName;
                    user.Password = password;
                    isLogin = user.Login();
                    return isLogin;
                }
            }

     
    Well i'm trying to add contacts by email of users. Can you please check the above Chat provider and please let me know what to add insiickname and in loginname in GetLogonIdentity() mehtod.
     
    At present im passing  
    //need to find the information of current user. Return null if user is anonymous.
                  //string loginname=...
                  //string nickname=...
                  //return new AppChatIdentity(nickname, false, ToUserId(loginname), HttpContext.Current.Request.UserHostAddress);         
     return new AppChatIdentity(userContext.UserName, false, ToUserId(Utilities.GetUserEmail()),                                  HttpContext.Current.Request.UserHostAddress);
     
     
    In Our messenger we are adding users by the EmailID
     
    Please check the code .
    Thanks.

     
View as RSS news feed in XML