Пример #1
0
 internal void sendContactStatusChangeMessage(String username, MSNEnumerations.UserStatus status)
 {
     if (ContactStatusChanged != null)
     {
         ContactStatusChanged(username, status);
     }
 }
Пример #2
0
        internal void processMessage(MSNMessage message)
        {
            if (message.getCommand().Equals("CHG"))
            {
                currentStatus = MSNStaticHelperFunctions.toUserStatus(message.getData()[0]);

                controller.sendLocalClientStatusChangeMessage();
            }
            else if (message.getCommand().Equals("PRP"))
            {
                Console.WriteLine("MSNLocalClient.processMessage(" + message.ToString() + ") does not handle PRP YET!");
            }
            else if (message.getCommand().Equals("BLP"))
            {
                String[] data = message.getData();

                if (data[1].Equals("AL")) //allow unknown chat
                {
                    handleUnknownContact = MSNEnumerations.UnknownContact.allow_chat;
                }
                else if (data[1].Equals("BL")) //block unknown chat
                {
                    handleUnknownContact = MSNEnumerations.UnknownContact.disallow_chat;
                }
            }
            else if (message.getCommand().Equals("REA"))
            {
                String[] data = message.getData();
                if (data.Length >= 3)
                {
                    friendlyName = HttpUtility.UrlDecode(data[2]);
                    controller.sendLocalClientFriendlyNameChangeMessage();
                }
            }
            else if (message.getCommand().Equals("USR"))
            {
                String[] data = message.getData();
                if (data.Length >= 6)
                {
                    friendlyName = HttpUtility.UrlDecode(data[3]);
                    controller.sendLocalClientFriendlyNameChangeMessage();
                }
            }
        }
Пример #3
0
        internal static String fromUserStatus(MSNEnumerations.UserStatus userStatusCode)
        {
            //NLN - Available
            //BSY - Busy
            //IDL - Idle
            //BRB - Be Right Back
            //AWY - Away
            //PHN - On the Phone
            //LUN - Out to Lunch

            if (userStatusCode == MSNEnumerations.UserStatus.online)
            {
                return("NLN");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.busy)
            {
                return("BSY");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.offline)
            {
                return("HDN");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.be_right_back)
            {
                return("BRB");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.away)
            {
                return("AWY");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.on_the_phone)
            {
                return("PHN");
            }
            else if (userStatusCode == MSNEnumerations.UserStatus.out_to_lunch)
            {
                return("LUN");
            }
            else
            {
                throw new Exception("Unknown status code in MSNLocalClient.processMessage");
            }
        }