/** When the socket reader receives a property update from runtime, it decodes object ID * property ID and the new value of the property. It then calls this method of * the target object, to update the new value in property cache. After updating the cache, * this method then fires appropriate event in skype.events to notify the UI of what has happened. * DispatchPropertyUpdate is executed in the socket reader thread. */ internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue) { switch (propId) { case 202: /* Contact.P_TYPE */ cache[0] = hasValue; // if no value - invalidate cache if (hasValue) { cache_type = (SktContact.TYPE)value; if (skypeRef.logging) skypeRef.Log("Contact.P_TYPE = " + cache_type.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_TYPE - update without value"); skypeRef.events.FireOnContactType(this, cache_type); break; case 4: /* Contact.P_SKYPENAME */ cache[1] = hasValue; // if no value - invalidate cache if (hasValue) { cache_skypename = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_SKYPENAME = " + cache_skypename.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_SKYPENAME - update without value"); skypeRef.events.FireOnContactSkypename(this, cache_skypename); break; case 6: /* Contact.P_PSTNNUMBER */ cache[2] = hasValue; // if no value - invalidate cache if (hasValue) { cache_pstnnumber = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PSTNNUMBER = " + cache_pstnnumber.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PSTNNUMBER - update without value"); skypeRef.events.FireOnContactPstnnumber(this, cache_pstnnumber); break; case 5: /* Contact.P_FULLNAME */ cache[3] = hasValue; // if no value - invalidate cache if (hasValue) { cache_fullname = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_FULLNAME = " + cache_fullname.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_FULLNAME - update without value"); skypeRef.events.FireOnContactFullname(this, cache_fullname); break; case 7: /* Contact.P_BIRTHDAY */ cache[4] = hasValue; // if no value - invalidate cache if (hasValue) { cache_birthday = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_BIRTHDAY = " + cache_birthday.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_BIRTHDAY - update without value"); skypeRef.events.FireOnContactBirthday(this, cache_birthday); break; case 8: /* Contact.P_GENDER */ cache[5] = hasValue; // if no value - invalidate cache if (hasValue) { cache_gender = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_GENDER = " + cache_gender.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_GENDER - update without value"); skypeRef.events.FireOnContactGender(this, cache_gender); break; case 9: /* Contact.P_LANGUAGES */ cache[6] = hasValue; // if no value - invalidate cache if (hasValue) { cache_languages = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_LANGUAGES = " + cache_languages.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_LANGUAGES - update without value"); skypeRef.events.FireOnContactLanguages(this, cache_languages); break; case 10: /* Contact.P_COUNTRY */ cache[7] = hasValue; // if no value - invalidate cache if (hasValue) { cache_country = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_COUNTRY = " + cache_country.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_COUNTRY - update without value"); skypeRef.events.FireOnContactCountry(this, cache_country); break; case 11: /* Contact.P_PROVINCE */ cache[8] = hasValue; // if no value - invalidate cache if (hasValue) { cache_province = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PROVINCE = " + cache_province.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PROVINCE - update without value"); skypeRef.events.FireOnContactProvince(this, cache_province); break; case 12: /* Contact.P_CITY */ cache[9] = hasValue; // if no value - invalidate cache if (hasValue) { cache_city = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_CITY = " + cache_city.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_CITY - update without value"); skypeRef.events.FireOnContactCity(this, cache_city); break; case 13: /* Contact.P_PHONE_HOME */ cache[10] = hasValue; // if no value - invalidate cache if (hasValue) { cache_phone_home = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_HOME = " + cache_phone_home.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_HOME - update without value"); skypeRef.events.FireOnContactPhoneHome(this, cache_phone_home); break; case 14: /* Contact.P_PHONE_OFFICE */ cache[11] = hasValue; // if no value - invalidate cache if (hasValue) { cache_phone_office = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_OFFICE = " + cache_phone_office.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_OFFICE - update without value"); skypeRef.events.FireOnContactPhoneOffice(this, cache_phone_office); break; case 15: /* Contact.P_PHONE_MOBILE */ cache[12] = hasValue; // if no value - invalidate cache if (hasValue) { cache_phone_mobile = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_MOBILE = " + cache_phone_mobile.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_MOBILE - update without value"); skypeRef.events.FireOnContactPhoneMobile(this, cache_phone_mobile); break; case 16: /* Contact.P_EMAILS */ cache[13] = hasValue; // if no value - invalidate cache if (hasValue) { cache_emails = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_EMAILS = " + cache_emails.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_EMAILS - update without value"); skypeRef.events.FireOnContactEmails(this, cache_emails); break; case 17: /* Contact.P_HOMEPAGE */ cache[14] = hasValue; // if no value - invalidate cache if (hasValue) { cache_homepage = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_HOMEPAGE = " + cache_homepage.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_HOMEPAGE - update without value"); skypeRef.events.FireOnContactHomepage(this, cache_homepage); break; case 18: /* Contact.P_ABOUT */ cache[15] = hasValue; // if no value - invalidate cache if (hasValue) { cache_about = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ABOUT = " + cache_about.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ABOUT - update without value"); skypeRef.events.FireOnContactAbout(this, cache_about); break; case 37: /* Contact.P_AVATAR_IMAGE */ cache[16] = hasValue; // if no value - invalidate cache if (hasValue) { cache_avatar_image = (byte[])value; if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_IMAGE = binary size " + cache_avatar_image.Length.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_IMAGE - update without value"); skypeRef.events.FireOnContactAvatarImage(this, cache_avatar_image); break; case 26: /* Contact.P_MOOD_TEXT */ cache[17] = hasValue; // if no value - invalidate cache if (hasValue) { cache_mood_text = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TEXT = " + cache_mood_text.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TEXT - update without value"); skypeRef.events.FireOnContactMoodText(this, cache_mood_text); break; case 205: /* Contact.P_RICH_MOOD_TEXT */ cache[18] = hasValue; // if no value - invalidate cache if (hasValue) { cache_rich_mood_text = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_RICH_MOOD_TEXT = " + cache_rich_mood_text.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_RICH_MOOD_TEXT - update without value"); skypeRef.events.FireOnContactRichMoodText(this, cache_rich_mood_text); break; case 27: /* Contact.P_TIMEZONE */ cache[19] = hasValue; // if no value - invalidate cache if (hasValue) { cache_timezone = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_TIMEZONE = " + cache_timezone.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_TIMEZONE - update without value"); skypeRef.events.FireOnContactTimezone(this, cache_timezone); break; case 36: /* Contact.P_CAPABILITIES */ cache[20] = hasValue; // if no value - invalidate cache if (hasValue) { cache_capabilities = (byte[])value; if (skypeRef.logging) skypeRef.Log("Contact.P_CAPABILITIES = binary size " + cache_capabilities.Length.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_CAPABILITIES - update without value"); skypeRef.events.FireOnContactCapabilities(this, cache_capabilities); break; case 19: /* Contact.P_PROFILE_TIMESTAMP */ cache[21] = hasValue; // if no value - invalidate cache if (hasValue) { cache_profile_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_PROFILE_TIMESTAMP = " + cache_profile_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_PROFILE_TIMESTAMP - update without value"); skypeRef.events.FireOnContactProfileTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_profile_timestamp)); break; case 28: /* Contact.P_NROF_AUTHED_BUDDIES */ cache[22] = hasValue; // if no value - invalidate cache if (hasValue) { cache_nrof_authed_buddies = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_NROF_AUTHED_BUDDIES = " + cache_nrof_authed_buddies.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_NROF_AUTHED_BUDDIES - update without value"); skypeRef.events.FireOnContactNrofAuthedBuddies(this, cache_nrof_authed_buddies); break; case 29: /* Contact.P_IPCOUNTRY */ cache[23] = hasValue; // if no value - invalidate cache if (hasValue) { cache_ipcountry = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_IPCOUNTRY = " + cache_ipcountry.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_IPCOUNTRY - update without value"); skypeRef.events.FireOnContactIpcountry(this, cache_ipcountry); break; case 182: /* Contact.P_AVATAR_TIMESTAMP */ cache[24] = hasValue; // if no value - invalidate cache if (hasValue) { cache_avatar_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_TIMESTAMP = " + cache_avatar_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_TIMESTAMP - update without value"); skypeRef.events.FireOnContactAvatarTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_avatar_timestamp)); break; case 183: /* Contact.P_MOOD_TIMESTAMP */ cache[25] = hasValue; // if no value - invalidate cache if (hasValue) { cache_mood_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TIMESTAMP = " + cache_mood_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TIMESTAMP - update without value"); skypeRef.events.FireOnContactMoodTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_mood_timestamp)); break; case 20: /* Contact.P_RECEIVED_AUTHREQUEST */ cache[26] = hasValue; // if no value - invalidate cache if (hasValue) { cache_received_authrequest = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_RECEIVED_AUTHREQUEST = " + cache_received_authrequest.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_RECEIVED_AUTHREQUEST - update without value"); skypeRef.events.FireOnContactReceivedAuthrequest(this, cache_received_authrequest); break; case 25: /* Contact.P_AUTHREQ_TIMESTAMP */ cache[27] = hasValue; // if no value - invalidate cache if (hasValue) { cache_authreq_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQ_TIMESTAMP = " + cache_authreq_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQ_TIMESTAMP - update without value"); skypeRef.events.FireOnContactAuthreqTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_authreq_timestamp)); break; case 35: /* Contact.P_LASTONLINE_TIMESTAMP */ cache[28] = hasValue; // if no value - invalidate cache if (hasValue) { cache_lastonline_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_LASTONLINE_TIMESTAMP = " + cache_lastonline_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_LASTONLINE_TIMESTAMP - update without value"); skypeRef.events.FireOnContactLastonlineTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_lastonline_timestamp)); break; case 34: /* Contact.P_AVAILABILITY */ cache[29] = hasValue; // if no value - invalidate cache if (hasValue) { cache_availability = (SktContact.AVAILABILITY)value; if (skypeRef.logging) skypeRef.Log("Contact.P_AVAILABILITY = " + cache_availability.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_AVAILABILITY - update without value"); skypeRef.events.FireOnContactAvailability(this, cache_availability); break; case 21: /* Contact.P_DISPLAYNAME */ cache[30] = hasValue; // if no value - invalidate cache if (hasValue) { cache_displayname = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_DISPLAYNAME = " + cache_displayname.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_DISPLAYNAME - update without value"); skypeRef.events.FireOnContactDisplayname(this, cache_displayname); break; case 22: /* Contact.P_REFRESHING */ cache[31] = hasValue; // if no value - invalidate cache if (hasValue) { cache_refreshing = (Boolean)value; if (skypeRef.logging) skypeRef.Log("Contact.P_REFRESHING = " + cache_refreshing.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_REFRESHING - update without value"); skypeRef.events.FireOnContactRefreshing(this, cache_refreshing); break; case 23: /* Contact.P_GIVEN_AUTHLEVEL */ cache[32] = hasValue; // if no value - invalidate cache if (hasValue) { cache_given_authlevel = (SktContact.AUTHLEVEL)value; if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_AUTHLEVEL = " + cache_given_authlevel.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_AUTHLEVEL - update without value"); skypeRef.events.FireOnContactGivenAuthlevel(this, cache_given_authlevel); break; case 33: /* Contact.P_GIVEN_DISPLAYNAME */ cache[33] = hasValue; // if no value - invalidate cache if (hasValue) { cache_given_displayname = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_DISPLAYNAME = " + cache_given_displayname.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_DISPLAYNAME - update without value"); skypeRef.events.FireOnContactGivenDisplayname(this, cache_given_displayname); break; case 180: /* Contact.P_ASSIGNED_COMMENT */ cache[34] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_comment = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_COMMENT = " + cache_assigned_comment.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_COMMENT - update without value"); skypeRef.events.FireOnContactAssignedComment(this, cache_assigned_comment); break; case 39: /* Contact.P_LASTUSED_TIMESTAMP */ cache[35] = hasValue; // if no value - invalidate cache if (hasValue) { cache_lastused_timestamp = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_LASTUSED_TIMESTAMP = " + cache_lastused_timestamp.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_LASTUSED_TIMESTAMP - update without value"); skypeRef.events.FireOnContactLastusedTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_lastused_timestamp)); break; case 41: /* Contact.P_AUTHREQUEST_COUNT */ cache[36] = hasValue; // if no value - invalidate cache if (hasValue) { cache_authrequest_count = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQUEST_COUNT = " + cache_authrequest_count.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQUEST_COUNT - update without value"); skypeRef.events.FireOnContactAuthrequestCount(this, cache_authrequest_count); break; case 184: /* Contact.P_ASSIGNED_PHONE1 */ cache[37] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone1 = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1 = " + cache_assigned_phone1.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1 - update without value"); skypeRef.events.FireOnContactAssignedPhone1(this, cache_assigned_phone1); break; case 185: /* Contact.P_ASSIGNED_PHONE1_LABEL */ cache[38] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone1_label = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1_LABEL = " + cache_assigned_phone1_label.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1_LABEL - update without value"); skypeRef.events.FireOnContactAssignedPhone1Label(this, cache_assigned_phone1_label); break; case 186: /* Contact.P_ASSIGNED_PHONE2 */ cache[39] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone2 = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2 = " + cache_assigned_phone2.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2 - update without value"); skypeRef.events.FireOnContactAssignedPhone2(this, cache_assigned_phone2); break; case 187: /* Contact.P_ASSIGNED_PHONE2_LABEL */ cache[40] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone2_label = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2_LABEL = " + cache_assigned_phone2_label.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2_LABEL - update without value"); skypeRef.events.FireOnContactAssignedPhone2Label(this, cache_assigned_phone2_label); break; case 188: /* Contact.P_ASSIGNED_PHONE3 */ cache[41] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone3 = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3 = " + cache_assigned_phone3.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3 - update without value"); skypeRef.events.FireOnContactAssignedPhone3(this, cache_assigned_phone3); break; case 189: /* Contact.P_ASSIGNED_PHONE3_LABEL */ cache[42] = hasValue; // if no value - invalidate cache if (hasValue) { cache_assigned_phone3_label = (String)value; if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3_LABEL = " + cache_assigned_phone3_label.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3_LABEL - update without value"); skypeRef.events.FireOnContactAssignedPhone3Label(this, cache_assigned_phone3_label); break; case 42: /* Contact.P_POPULARITY_ORD */ cache[43] = hasValue; // if no value - invalidate cache if (hasValue) { cache_popularity_ord = (uint)value; if (skypeRef.logging) skypeRef.Log("Contact.P_POPULARITY_ORD = " + cache_popularity_ord.ToString()); } else if (skypeRef.logging) skypeRef.Log("Contact.P_POPULARITY_ORD - update without value"); skypeRef.events.FireOnContactPopularityOrd(this, cache_popularity_ord); break; default: skypeRef.Error(String.Format("Invalid Contact class property ID ({0})received from socket.", propId)); break; } }
internal void FetchTypeFromRuntime() { if (skypeRef.logging) skypeRef.Log("Fetching P_TYPE from runtime"); skypeRef.transport.SubmitPropertyRequest(2, 202, this.OID); if (skypeRef.transport.PropResponseWasOk(202)) { cache_type = (SktContact.TYPE)skypeRef.decoder.DecodeUint(); cache[0] = true; } skypeRef.transport.ResumeSocketReaderFromPropRequest(); }
public OnContactTypeArgs(SktContact sender, SktContact.TYPE newValue) { this.sender = sender; value = newValue; }