How does Chat_OpenMessenger() know which user it is?

Last post 07-12-2006, 5:04 AM by cutechat. 8 replies.
Sort Posts: Previous Next
  •  06-07-2006, 4:45 PM 19893

    How does Chat_OpenMessenger() know which user it is?

    Is there like a CurrentUser.UserID = customID or something?

    I have existing clientIDs and want to log them into messenger, but when I call Chat_OpenMessenger() how do I tell the messenger which user it is?  Help please.  Thanks.
  •  06-08-2006, 9:10 AM 19914 in reply to 19893

    Re: How does Chat_OpenMessenger() know which user it is?

    hello?
  •  06-10-2006, 11:58 AM 19994 in reply to 19893

    Re: How does Chat_OpenMessenger() know which user it is?

    Jon.Lee :
     
    The messenger use the UserAdapter to get the information of current user .
     
    Please check the global.asax code , for example , the code :
     
      public string GetUserUniqueName() 
      {
       if(Context.User.Identity.IsAuthenticated)
        return Context.User.Identity.Name;
       return null;
      }
     
    As you mention that , you find "null" user in the database ?
     
    maybe you make wrong in this file . do not return string ["null"] , return [null] instead.
     
    Regards , Terry .
  •  06-13-2006, 9:14 PM 20110 in reply to 19994

    Re: How does Chat_OpenMessenger() know which user it is?

    Sorry, so just that I understand.   If I already have the unique username specific to our website (i.e. through a cookie, query string, etc) I would just return that value like so?...
     
    public string GetUserUniqueName() 
      {
       if(Context.User.Identity.IsAuthenticated)
        return HttpContext.Current.Request.Cookies("username");
      }
     
     
    And that would tell the messenger which user loaded the messenger?
     
    Thanks in advance.
     
  •  07-04-2006, 5:25 PM 20705 in reply to 20110

    Re: How does Chat_OpenMessenger() know which user it is?

    bump
  •  07-05-2006, 2:31 AM 20719 in reply to 20705

    Re: How does Chat_OpenMessenger() know which user it is?

    >>And that would tell the messenger which user loaded the messenger?
     
    Yes. That's good enough.
     
    Let me know if you have any further questions. I feel I haven't fully answered your questions.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-11-2006, 2:27 PM 20895 in reply to 20719

    Re: How does Chat_OpenMessenger() know which user it is?

    yeah sorry but i'm totally lost.  Management is beginning to think it may be more cost efficient to create our own IM? 

    I edited the Global.asax:

    public string GetUserUniqueName() 
      {
       if(Context.User.Identity.IsAuthenticated)
        return HttpContext.Current.Request.Cookies("username");
      }


    ... now what?  please outline the steps needed to get this thing to work (with some more examples).  thank you.
  •  07-11-2006, 3:14 PM 20899 in reply to 20895

    Re: How does Chat_OpenMessenger() know which user it is?

    The role of GetUserDisplayName is helping you get  user's display name based on the user's UniqueName.
     
     
    Before you get started, you need to understand the 'UniqueName' in CuteChat. In CuteChat, UniqueName means the unique data of your user. Depending on how you implement the user system, in some systems, the best unique data is the user ID; in some system, every user have a unique account name; some systems like MSN, the unique data is the user email. It could be string(username, email), integer(user ID) or GUID.
     
     
    You can just change it to:
     
    public string GetUserDisplayName(string useruniquename)
    {
       return useruniquename;
    }
     
    When you get comfortable with the integration part, then change the above code to something make sense to your system.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  07-12-2006, 5:04 AM 20918 in reply to 20895

    Re: How does Chat_OpenMessenger() know which user it is?

    Jon.Lee :
     
    It seems that you have your own method to store the login data for user .
    So, Context.User.Identity.IsAuthenticated is not useful for you .
     
    You can try:
     
    public string GetUserUniqueName() 
      {
        HttpCookie cookie=HttpContext.Current.Request.Cookies["username"];
        if(cookie==null)return null;
        string name=cookie.Value;
        if(name==null||name=="")return null;
        //TODO : check the cookie username/password again
        return name;
      }
     
    Regards , Terry .
View as RSS news feed in XML