Chat administration problems

Last post 08-26-2009, 1:40 AM by dhananjaym. 8 replies.
Sort Posts: Previous Next
  •  02-19-2009, 9:14 AM 49004

    Chat administration problems

    I have met with following difficulties:

    1. When I try to kick authenticated user from the chat room I get 'The specified user is currently offline or does not exist.' message instead of banning that user.

    2. When I open moderate chat mode and other user sends messages in the chat, I don't see this messages in the Moderator message queue window on the administrator side until I reload the page.

    Please help me with this issues.

    Filed under:
  •  02-23-2009, 6:03 AM 49095 in reply to 49004

    Re: Chat administration problems

    I'm still waiting for your answer...
  •  08-17-2009, 2:09 AM 54728 in reply to 49095

    Re: Chat administration problems

    I have been facing the same issue, specifically with admin features of moderator, I am unable to kick a user out of a room and get the same message as above. Do we have any solution yet?
     
     
  •  08-21-2009, 4:47 AM 54889 in reply to 54728

    Re: Chat administration problems

    Any solution to this issue? Or has someone able to build a workaround for this?
  •  08-21-2009, 8:46 AM 54895 in reply to 49004

    Re: Chat administration problems

    Hi,
     
    Can you post the ChatProvider code ?
     
    I think the GetUserInfo is wrong.
     
    Regards,
    Terry
  •  08-24-2009, 1:20 AM 54940 in reply to 54895

    Re: Chat administration problems

      public class ChatClient : ChatProvider
        {
          
            private class RelationshipFile
            {
                public UserApi.Relationship Relationship { get; set; }
                public MediaApi.File File { get; set; }
            }

            #region        //TODO:integration code for friend list:
            public override AppDataManager CreateDataManagerInstance(AppPortal portal)
            {
                return new MyDataManager(portal);
            }

            class MyDataManager : AppDataManager
            {

                public override IChatUserInfo[] GetContacts(ChatIdentity identity)
                {
                    string myname = ChatProvider.Instance.FromUserId(identity.UniqueId);

                    UserData userdata = new UserData();

                    string[] friends = userdata.GetUsersFriends(myname);
                    IChatUserInfo[] arr = null;
                    if (friends != null)
                    {
                        arr = new IChatUserInfo[friends.Length];
                        for (int i = 0; i < friends.Length; i++)
                        {
                            string friendid = ChatProvider.Instance.ToUserId(friends[i]);
                            arr[i] = base.GetUserInfo(friendid);
                            //arr[i].DisplayName = "";
                        }
                    }
                    else
                    {
                        arr = new IChatUserInfo[0];
                    }
                   
                    return arr;
                }

                public override void AddIgnore(ChatIdentity identity, string userid)
                {
                    base.AddIgnore(identity, userid);
                }
                public override void RemoveIgnore(ChatIdentity identity, string userid)
                {
                    base.RemoveIgnore(identity, userid);
                }
                public override IChatUserInfo[] GetIgnores(ChatIdentity identity)
                {
                    return base.GetIgnores(identity);
                }


                public MyDataManager(AppPortal portal)
                    : base(portal)
                {
                }
            }
            #endregion

            public override String GetConnectionString()
            {
                //return System.Configuration.ConfigurationSettings.AppSettings["Site.Properties.Settings.DatabaseConnection]"];

                return Properties.Settings.Default.DatabaseConnection;
                
            }

            /// <summary>
            /// find the username by the displayname
            /// </summary>
            public override string FindUserLoginName(string nickName)
            {
                UserData userdata = new UserData();
                if (userdata.IsUserExistByScreename(nickName))
                    return nickName;
                return null;
            }

            public override bool GetUserInfo(string loginName, ref string nickName)
            {
                UserData userdata = new UserData();
                if (!userdata.IsUsernameExists(loginName))
                    return false;

                nickName = loginName;

                Huzu.UserModule.Classes.User userObj = Huzu.UserModule.Classes.User.CreateByUsername(loginName);

                if (userObj != null)
                {
                    nickName = userObj.Screenname;
                }

                return true;
            }

            /// <summary>
            /// get the information from the user
            /// This function is very important and be called very frequently.
            /// </summary>
            public override bool GetUserInfo(string loginName, ref string nickName, ref bool isAdmin)
            {
                UserData userdata = new UserData();

                if (!userdata.IsUsernameExists(loginName))
                    return false;

                nickName = loginName;

                isAdmin = false; //SamplePortal.Global.IsUserInRole("Admins", loginName);

                Huzu.UserModule.Classes.User userObj = Huzu.UserModule.Classes.User.CreateByUsername(loginName);


                if (userObj != null)
                {
                    if (userObj.IsInRole(Properties.Settings.Default.AdminUserRoleId))
                    {
                        isAdmin = true;
                    }
                    nickName = userObj.Screenname;
                }
                
                return true;
            }

            /// <summary>
            /// validate the user , and set the cookie
            /// </summary>
            public override bool ValidateUser(string loginName, string pwd)
            {
                UserData userdata = new UserData();
                if (!userdata.Login(loginName, pwd))
                    return false;

                System.Web.Security.FormsAuthentication.SetAuthCookie(loginName, false, "/");

                return true;
            }

            public override AppChatIdentity GetLogonIdentity()
            {
                string loginname = "";
                string nickname = "";
                if (UserApi.User.IsLoggedIn)
                {
                    loginname = UserApi.User.LoggedInUser.Username;
                    nickname = UserApi.User.LoggedInUser.Username; //this needs to be changed to Screename
                    return new AppChatIdentity(nickname, false, ToUserId(loginname), HttpContext.Current.Request.UserHostAddress);
                }
                else
                {
                    return null; //TODO: Redirect to login page
                }
                
            }

        }
  •  08-25-2009, 5:14 AM 55008 in reply to 54940

    Re: Chat administration problems

    Is there any problem with the above code?
  •  08-25-2009, 9:55 AM 55025 in reply to 55008

    Re: Chat administration problems

    Hi,
     
    Can  your kick an anonymous ?
     
    Regards,
    Terry
  •  08-26-2009, 1:40 AM 55052 in reply to 55025

    Re: Chat administration problems

    Hi Terry,
     
    We don't allow anonymous users on our site.  This issue comes in particular in 2 scenarios:
     
    1) Signed user is admin of site & Chat( isAdmin = true) , but he is not in the moderator list. At this point the user gets the Admin panel on the chat room, but whenever he tries to do any admin operation like Kick, Block or assign role to a "normal" user we get this message of "sepcified user is offline......".
     
    2) In second case, when the admin is also in the moderator list for a Chat Room. When the admin signs in and tries to kick another moderator in the Room, he is shown similar message. I would say he should be shown and alert saying that admin cannot kick a moderator of a room( assuming that is the case).
     
     Well my major concern is for first scenario. Can you guide me how to address this issue?
     
    Regards,
    DJ
View as RSS news feed in XML