Exemplo n.º 1
0
 internal void FetchLastLeavereasonFromRuntime()
 {
     if (skypeRef.logging) skypeRef.Log("Fetching P_LAST_LEAVEREASON from runtime");
     skypeRef.transport.SubmitPropertyRequest(19, 955, this.OID);
     if (skypeRef.transport.PropResponseWasOk(955))
     {
     cache_last_leavereason = (SktSkype.LEAVE_REASON)skypeRef.decoder.DecodeUint();
     cache[20] = true;
     }
     skypeRef.transport.ResumeSocketReaderFromPropRequest();
 }
Exemplo n.º 2
0
        /** 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 930: /* Participant.P_CONVO_ID */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_convo_id = (SktConversation)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_CONVO_ID = " + cache_convo_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_CONVO_ID - update without value");
                skypeRef.events.FireOnParticipantConvoId(this, cache_convo_id);
                break;

            case 931: /* Participant.P_IDENTITY */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_identity = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_IDENTITY = " + cache_identity.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_IDENTITY - update without value");
                skypeRef.events.FireOnParticipantIdentity(this, cache_identity);
                break;

            case 932: /* Participant.P_RANK */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_rank = (SktParticipant.RANK)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_RANK = " + cache_rank.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_RANK - update without value");
                skypeRef.events.FireOnParticipantRank(this, cache_rank);
                break;

            case 933: /* Participant.P_REQUESTED_RANK */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_requested_rank = (SktParticipant.RANK)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_REQUESTED_RANK = " + cache_requested_rank.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_REQUESTED_RANK - update without value");
                skypeRef.events.FireOnParticipantRequestedRank(this, cache_requested_rank);
                break;

            case 934: /* Participant.P_TEXT_STATUS */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_text_status = (SktParticipant.TEXT_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_TEXT_STATUS = " + cache_text_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_TEXT_STATUS - update without value");
                skypeRef.events.FireOnParticipantTextStatus(this, cache_text_status);
                break;

            case 935: /* Participant.P_VOICE_STATUS */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_voice_status = (SktParticipant.VOICE_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_VOICE_STATUS = " + cache_voice_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_VOICE_STATUS - update without value");
                skypeRef.events.FireOnParticipantVoiceStatus(this, cache_voice_status);
                break;

            case 936: /* Participant.P_VIDEO_STATUS */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_video_status = (SktParticipant.VIDEO_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_VIDEO_STATUS = " + cache_video_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_VIDEO_STATUS - update without value");
                skypeRef.events.FireOnParticipantVideoStatus(this, cache_video_status);
                break;

            case 943: /* Participant.P_LIVE_IDENTITY */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_identity = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_IDENTITY = " + cache_live_identity.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_IDENTITY - update without value");
                skypeRef.events.FireOnParticipantLiveIdentity(this, cache_live_identity);
                break;

            case 938: /* Participant.P_LIVE_PRICE_FOR_ME */
                cache[8] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_price_for_me = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_PRICE_FOR_ME = " + cache_live_price_for_me.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_PRICE_FOR_ME - update without value");
                skypeRef.events.FireOnParticipantLivePriceForMe(this, cache_live_price_for_me);
                break;

            case 948: /* Participant.P_LIVE_FWD_IDENTITIES */
                cache[9] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_fwd_identities = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_FWD_IDENTITIES = " + cache_live_fwd_identities.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_FWD_IDENTITIES - update without value");
                skypeRef.events.FireOnParticipantLiveFwdIdentities(this, cache_live_fwd_identities);
                break;

            case 939: /* Participant.P_LIVE_START_TIMESTAMP */
                cache[10] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_start_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_START_TIMESTAMP = " + cache_live_start_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_START_TIMESTAMP - update without value");
                skypeRef.events.FireOnParticipantLiveStartTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_live_start_timestamp));
                break;

            case 941: /* Participant.P_SOUND_LEVEL */
                cache[11] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_sound_level = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_SOUND_LEVEL = " + cache_sound_level.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_SOUND_LEVEL - update without value");
                skypeRef.events.FireOnParticipantSoundLevel(this, cache_sound_level);
                break;

            case 942: /* Participant.P_DEBUGINFO */
                cache[12] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_debuginfo = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_DEBUGINFO = " + cache_debuginfo.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_DEBUGINFO - update without value");
                skypeRef.events.FireOnParticipantDebuginfo(this, cache_debuginfo);
                break;

            case 947: /* Participant.P_LAST_VOICE_ERROR */
                cache[13] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_last_voice_error = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LAST_VOICE_ERROR = " + cache_last_voice_error.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LAST_VOICE_ERROR - update without value");
                skypeRef.events.FireOnParticipantLastVoiceError(this, cache_last_voice_error);
                break;

            case 949: /* Participant.P_QUALITY_PROBLEMS */
                cache[14] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_quality_problems = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_QUALITY_PROBLEMS = " + cache_quality_problems.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_QUALITY_PROBLEMS - update without value");
                skypeRef.events.FireOnParticipantQualityProblems(this, cache_quality_problems);
                break;

            case 950: /* Participant.P_LIVE_TYPE */
                cache[15] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_type = (SktSkype.IDENTITYTYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_TYPE = " + cache_live_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_TYPE - update without value");
                skypeRef.events.FireOnParticipantLiveType(this, cache_live_type);
                break;

            case 951: /* Participant.P_LIVE_COUNTRY */
                cache[16] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_country = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_COUNTRY = " + cache_live_country.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LIVE_COUNTRY - update without value");
                skypeRef.events.FireOnParticipantLiveCountry(this, cache_live_country);
                break;

            case 952: /* Participant.P_TRANSFERRED_BY */
                cache[17] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_transferred_by = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_TRANSFERRED_BY = " + cache_transferred_by.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_TRANSFERRED_BY - update without value");
                skypeRef.events.FireOnParticipantTransferredBy(this, cache_transferred_by);
                break;

            case 953: /* Participant.P_TRANSFERRED_TO */
                cache[18] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_transferred_to = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_TRANSFERRED_TO = " + cache_transferred_to.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_TRANSFERRED_TO - update without value");
                skypeRef.events.FireOnParticipantTransferredTo(this, cache_transferred_to);
                break;

            case 954: /* Participant.P_ADDER */
                cache[19] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_adder = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_ADDER = " + cache_adder.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_ADDER - update without value");
                skypeRef.events.FireOnParticipantAdder(this, cache_adder);
                break;

            case 955: /* Participant.P_LAST_LEAVEREASON */
                cache[20] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_last_leavereason = (SktSkype.LEAVE_REASON)value;
                    if (skypeRef.logging) skypeRef.Log("Participant.P_LAST_LEAVEREASON = " + cache_last_leavereason.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Participant.P_LAST_LEAVEREASON - update without value");
                skypeRef.events.FireOnParticipantLastLeavereason(this, cache_last_leavereason);
                break;

            default:
                skypeRef.Error(String.Format("Invalid Participant class property ID ({0})received from socket.", propId)); break;
            }
        }
Exemplo n.º 3
0
 public OnParticipantLastLeavereasonArgs(SktParticipant sender, SktSkype.LEAVE_REASON newValue)
 {
     this.sender = sender;  value = newValue;
 }
Exemplo n.º 4
0
        /** 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 960: /* Message.P_CONVO_ID */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_convo_id = (SktConversation)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_CONVO_ID = " + cache_convo_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_CONVO_ID - update without value");
                skypeRef.events.FireOnMessageConvoId(this, cache_convo_id);
                break;

            case 120: /* Message.P_CONVO_GUID */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_convo_guid = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_CONVO_GUID = " + cache_convo_guid.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_CONVO_GUID - update without value");
                skypeRef.events.FireOnMessageConvoGuid(this, cache_convo_guid);
                break;

            case 122: /* Message.P_AUTHOR */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_author = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_AUTHOR = " + cache_author.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_AUTHOR - update without value");
                skypeRef.events.FireOnMessageAuthor(this, cache_author);
                break;

            case 123: /* Message.P_AUTHOR_DISPLAYNAME */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_author_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_AUTHOR_DISPLAYNAME = " + cache_author_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_AUTHOR_DISPLAYNAME - update without value");
                skypeRef.events.FireOnMessageAuthorDisplayname(this, cache_author_displayname);
                break;

            case 792: /* Message.P_GUID */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_guid = (byte[])value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_GUID = binary size " + cache_guid.Length.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_GUID - update without value");
                skypeRef.events.FireOnMessageGuid(this, cache_guid);
                break;

            case 790: /* Message.P_ORIGINALLY_MEANT_FOR */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_originally_meant_for = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_ORIGINALLY_MEANT_FOR = " + cache_originally_meant_for.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_ORIGINALLY_MEANT_FOR - update without value");
                skypeRef.events.FireOnMessageOriginallyMeantFor(this, cache_originally_meant_for);
                break;

            case 121: /* Message.P_TIMESTAMP */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_TIMESTAMP = " + cache_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_TIMESTAMP - update without value");
                skypeRef.events.FireOnMessageTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_timestamp));
                break;

            case 961: /* Message.P_TYPE */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_type = (SktMessage.TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_TYPE = " + cache_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_TYPE - update without value");
                skypeRef.events.FireOnMessageType(this, cache_type);
                break;

            case 962: /* Message.P_SENDING_STATUS */
                cache[8] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_sending_status = (SktMessage.SENDING_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_SENDING_STATUS = " + cache_sending_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_SENDING_STATUS - update without value");
                skypeRef.events.FireOnMessageSendingStatus(this, cache_sending_status);
                break;

            case 968: /* Message.P_CONSUMPTION_STATUS */
                cache[9] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_consumption_status = (SktMessage.CONSUMPTION_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_CONSUMPTION_STATUS = " + cache_consumption_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_CONSUMPTION_STATUS - update without value");
                skypeRef.events.FireOnMessageConsumptionStatus(this, cache_consumption_status);
                break;

            case 222: /* Message.P_EDITED_BY */
                cache[10] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_edited_by = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_EDITED_BY = " + cache_edited_by.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_EDITED_BY - update without value");
                skypeRef.events.FireOnMessageEditedBy(this, cache_edited_by);
                break;

            case 223: /* Message.P_EDIT_TIMESTAMP */
                cache[11] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_edit_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_EDIT_TIMESTAMP = " + cache_edit_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_EDIT_TIMESTAMP - update without value");
                skypeRef.events.FireOnMessageEditTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_edit_timestamp));
                break;

            case 963: /* Message.P_PARAM_KEY */
                cache[12] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_param_key = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_PARAM_KEY = " + cache_param_key.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_PARAM_KEY - update without value");
                skypeRef.events.FireOnMessageParamKey(this, cache_param_key);
                break;

            case 964: /* Message.P_PARAM_VALUE */
                cache[13] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_param_value = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_PARAM_VALUE = " + cache_param_value.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_PARAM_VALUE - update without value");
                skypeRef.events.FireOnMessageParamValue(this, cache_param_value);
                break;

            case 127: /* Message.P_BODY_XML */
                cache[14] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_body_xml = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_BODY_XML = " + cache_body_xml.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_BODY_XML - update without value");
                skypeRef.events.FireOnMessageBodyXml(this, cache_body_xml);
                break;

            case 125: /* Message.P_IDENTITIES */
                cache[15] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_identities = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_IDENTITIES = " + cache_identities.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_IDENTITIES - update without value");
                skypeRef.events.FireOnMessageIdentities(this, cache_identities);
                break;

            case 966: /* Message.P_REASON */
                cache[16] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_reason = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_REASON = " + cache_reason.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_REASON - update without value");
                skypeRef.events.FireOnMessageReason(this, cache_reason);
                break;

            case 126: /* Message.P_LEAVEREASON */
                cache[17] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_leavereason = (SktSkype.LEAVE_REASON)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_LEAVEREASON = " + cache_leavereason.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_LEAVEREASON - update without value");
                skypeRef.events.FireOnMessageLeavereason(this, cache_leavereason);
                break;

            case 982: /* Message.P_PARTICIPANT_COUNT */
                cache[18] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_participant_count = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Message.P_PARTICIPANT_COUNT = " + cache_participant_count.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Message.P_PARTICIPANT_COUNT - update without value");
                skypeRef.events.FireOnMessageParticipantCount(this, cache_participant_count);
                break;

            default:
                skypeRef.Error(String.Format("Invalid Message class property ID ({0})received from socket.", propId)); break;
            }
        }
Exemplo n.º 5
0
 public OnMessageLeavereasonArgs(SktMessage sender, SktSkype.LEAVE_REASON newValue)
 {
     this.sender = sender;  value = newValue;
 }