Skip to content

hangups state_update dumps

endofline edited this page Aug 8, 2015 · 2 revisions

DISCLAIMER: I did not write hangups - this is an independent documentation effort to aid development of [hangoutsbot] (https://github.com/hangoutsbot/hangoutsbot).

THIS DOCUMENTATION IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.


update_state dumps from [ConversationList._on_state_update()] (https://github.com/tdryer/hangups/blob/f2792e99d72673dc25e41427ff82255485d8da59/hangups/conversation.py#L404)

Message

Fires when [state_update.event_notification is not None] (https://github.com/tdryer/hangups/blob/f2792e99d72673dc25e41427ff82255485d8da59/hangups/conversation.py#L416)

Note: Extra info in state_update.event_notification.hangout_event when its a request related with [video hangouts] (hangups-state_update-dumps#video-hangout)

namespace(
    block_notification=None, 
    client_conversation=namespace(
        conversation_id=namespace(id_='UgwuxxxxxxxxxxxxxxxxxxxBAQ'), 
        current_participant=[
            namespace(
                chat_id='101111111111111111111', 
                gaia_id='101111111111111111111'), 
            namespace(
                chat_id='101111111111111111112', 
                gaia_id='101111111111111111112')], 
        name='#mentions', 
        otr_status=<OffTheRecordStatus.ON_THE_RECORD: 2>, 
        participant_data=[
            namespace(
                fallback_name='Some Person', 
                id_=namespace(
                    chat_id='101111111111111111112', 
                    gaia_id='101111111111111111112')), 
            namespace(
                fallback_name='LeRobot', 
                id_=namespace(
                    chat_id='101111111111111111111', 
                    gaia_id='101111111111111111111'))], 
        read_state=[
            namespace(
                last_read_timestamp=0, 
                participant_id=namespace(
                    chat_id='101111111111111111112', 
                    gaia_id='101111111111111111112')), 
            namespace(
                last_read_timestamp=0, 
                participant_id=namespace(
                    chat_id='101111111111111111111', 
                    gaia_id='101111111111111111111'))], 
        self_conversation_state=namespace(
            active_timestamp=1416905480118000, 
            invite_timestamp=1416904876940000, 
            inviter_id=namespace(
                chat_id='101111111111111111112', 
                gaia_id='101111111111111111112'), 
            notification_level=<ClientNotificationLevel.RING: 30>, 
            self_read_state=namespace(
                latest_read_timestamp=1437355303998661, 
                participant_id=namespace(
                    chat_id='101111111111111111111', 
                    gaia_id='101111111111111111111')), 
                sort_timestamp=1437355320868121, 
                status=<ClientConversationStatus.ACTIVE: 2>, 
                view=[
                    <ClientConversationView.INBOX_VIEW: 1>]), 
            type_=<ConversationType.STICKY_ONE_TO_ONE: 1>), 
        conversation_notification=None, 
        delete_notification=None, 
        easter_egg_notification=None, 
        event_notification=namespace(
            event=namespace(
                advances_sort_timestamp=None, 
                chat_message=namespace(
                    annotation=None, 
                    message_content=namespace(
                        attachment=None, 
                        segment=[
                            namespace(
                                formatting=namespace(
                                    bold=0, 
                                    italic=0, 
                                    strikethrough=0, 
                                    underline=0), 
                                link_data=None, 
                                text='test', 
                                type_=<SegmentType.TEXT: 0>)])), 
                conversation_id=namespace(
                    id_='UgwuxxxxxxxxxxxxxxxxxxxBAQ'), 
                conversation_rename=None, 
                event_id='1-A000-1aaa11aAaAA1aa1', 
                event_otr=<OffTheRecordStatus.ON_THE_RECORD: 2>, 
                hangout_event=None, 
                membership_change=None, 
                otr_modification=None, 
                self_event_state=namespace(
                    client_generated_id=None, 
                    notification_level=<ClientNotificationLevel.RING: 30>, 
                    user_id=namespace(
                        chat_id='101111111111111111111', 
                        gaia_id='101111111111111111111')), 
                sender_id=namespace(
                    chat_id='101111111111111111112', 
                    gaia_id='101111111111111111112'), 
                timestamp=1437355320868121)), 
        focus_notification=None, 
        invitation_watermark_notification=None, 
        notification_level_notification=None, 
        presence_notification=None, 
        reply_to_invite_notification=None, 
        self_presence_notification=None, 
        settings_notification=None, 
        state_update_header=namespace(
            active_client_state=<ActiveClientState.NO_ACTIVE_CLIENT: 0>, 
            current_server_time=1437355320702000, 
            request_trace_id='9317522414626951920'), 
        typing_notification=None, 
        view_modification=None, 
        watermark_notification=None)

Watermark

Fires when [state_update.watermark_notification is not None] (https://github.com/tdryer/hangups/blob/f2792e99d72673dc25e41427ff82255485d8da59/hangups/conversation.py#L412)

namespace(
    block_notification=None, 
    client_conversation=None, 
    conversation_notification=None, 
    delete_notification=None, 
    easter_egg_notification=None, 
    event_notification=None, 
    focus_notification=None, 
    invitation_watermark_notification=None, 
    notification_level_notification=None, 
    presence_notification=None, 
    reply_to_invite_notification=None, 
    self_presence_notification=None, 
    settings_notification=None, 
    state_update_header=namespace(
        active_client_state=<ActiveClientState.NO_ACTIVE_CLIENT: 0>, 
        current_server_time=1437353406684000, 
        request_trace_id='-3662070711367064859'), 
    typing_notification=None, 
    view_modification=None, 
    watermark_notification=namespace(
        conversation_id=namespace(
            id_='UgwuxxxxxxxxxxxxxxxxxxxBAQ'), 
        latest_read_timestamp=1437353406572400, 
        participant_id=namespace(
            chat_id='101111111111111111111', 
            gaia_id='101111111111111111111')))

Typing

Fires when [state_update.typing_notification is not None] (https://github.com/tdryer/hangups/blob/f2792e99d72673dc25e41427ff82255485d8da59/hangups/conversation.py#L408)

namespace(
    block_notification=None, 
    client_conversation=None, 
    conversation_notification=None, 
    delete_notification=None, 
    easter_egg_notification=None, 
    event_notification=None, 
    focus_notification=None, 
    invitation_watermark_notification=None, 
    notification_level_notification=None, 
    presence_notification=None, 
    reply_to_invite_notification=None, 
    self_presence_notification=None, 
    settings_notification=None, 
    state_update_header=namespace(
        active_client_state=<ActiveClientState.NO_ACTIVE_CLIENT: 0>, 
        current_server_time=1437353589222000, 
        request_trace_id='-8790807867461910431'), 
    typing_notification=namespace(
        conversation_id=namespace(id_='UgwuxxxxxxxxxxxxxxxxxxxBAQ'), 
        status=<TypingStatus.TYPING: 1>, 
        timestamp=1437353589222000, 
        user_id=namespace(
            chat_id='101111111111111111111', 
            gaia_id='101111111111111111111')), 
    view_modification=None, 
    watermark_notification=None)

Video Hangout

hangups doesn't detect this, suggested: state_update.event_notification.hangout_event is not None

Start of Hangouts Video Call:

namespace(
    block_notification=None, 
    client_conversation=namespace(
        conversation_id=namespace(id_='UgwxxxxxxxxxxxxxxxxxxxxBAQ'), 
        current_participant=[
            namespace(
                chat_id='100000000000000000001', 
                gaia_id='100000000000000000001'), 
            namespace(
                chat_id='100000000000000000002', 
                gaia_id='100000000000000000002')], 
        name=None, 
        otr_status=<OffTheRecordStatus.ON_THE_RECORD: 2>, 
        participant_data=[
            namespace(
                fallback_name='Some Person', 
                id_=namespace(
                    chat_id='100000000000000000002', 
                    gaia_id='100000000000000000002')), 
            namespace(
                fallback_name='Le Robot', 
                id_=namespace(
                    chat_id='100000000000000000001', 
                    gaia_id='100000000000000000001'))], 
        read_state=[
            namespace(
                last_read_timestamp=0, 
                participant_id=namespace(
                    chat_id='100000000000000000002', 
                    gaia_id='100000000000000000002')), 
            namespace(
                last_read_timestamp=0, 
                participant_id=namespace(
                    chat_id='100000000000000000001', 
                    gaia_id='100000000000000000001'))], 
        self_conversation_state=namespace(
            active_timestamp=1417593623996000, 
            invite_timestamp=1417593556961000, 
            inviter_id=namespace(
                chat_id='100000000000000000002', 
                gaia_id='100000000000000000002'), 
            notification_level=<ClientNotificationLevel.RING: 30>, 
            self_read_state=namespace(
                latest_read_timestamp=0, 
                participant_id=namespace(
                    chat_id='100000000000000000001', 
                    gaia_id='100000000000000000001')), 
            sort_timestamp=1437358851760274, 
            status=<ClientConversationStatus.ACTIVE: 2>, 
            view=[<ClientConversationView.INBOX_VIEW: 1>]), 
        type_=<ConversationType.STICKY_ONE_TO_ONE: 1>), 
    conversation_notification=None, 
    delete_notification=None, 
    easter_egg_notification=None, 
    event_notification=namespace(
        event=namespace(
            advances_sort_timestamp=None, 
            chat_message=None, 
            conversation_id=namespace(
                id_='UgwxxxxxxxxxxxxxxxxxxxxBAQ'), 
            conversation_rename=None, 
            event_id='1-A1A1-1AA-11aAAAAAAA', 
            event_otr=<OffTheRecordStatus.ON_THE_RECORD: 2>, 
            hangout_event=namespace(
                event_type=<ClientHangoutEventType.START_HANGOUT: 1>, 
                hangout_duration_secs=None, 
                is_periodic_refresh=None, 
                participant_id=[
                    namespace(chat_id='100000000000000000002', gaia_id='100000000000000000002')], 
                refresh_timeout_secs=None, 
                transferred_conversation_id=None), 
            membership_change=None, 
            otr_modification=None, 
            self_event_state=namespace(
                client_generated_id=None, 
                notification_level=<ClientNotificationLevel.RING: 30>, 
                user_id=namespace(
                    chat_id='100000000000000000001', 
                    gaia_id='100000000000000000001')), 
            sender_id=namespace(
                chat_id='100000000000000000002', 
                gaia_id='100000000000000000002'), 
            timestamp=1437358851760274)), 
    focus_notification=None, 
    invitation_watermark_notification=None, 
    notification_level_notification=None, 
    presence_notification=None, 
    reply_to_invite_notification=None, 
    self_presence_notification=None, 
    settings_notification=None, 
    state_update_header=namespace(
        active_client_state=<ActiveClientState.NO_ACTIVE_CLIENT: 0>, 
        current_server_time=1437358851760000, 
        request_trace_id='-2930741471253714714'), 
    typing_notification=None, 
    view_modification=None, 
    watermark_notification=None)

End of Video Hangouts Call

Fragment from state_update.event_notification.hangout_event

    event_type=<ClientHangoutEventType.END_HANGOUT: 2>, 
    hangout_duration_secs=25, 
    is_periodic_refresh=None, 
    participant_id=[namespace(
        chat_id='100000000000000000002', 
        gaia_id='100000000000000000002')], 
    refresh_timeout_secs=None, 
    transferred_conversation_id=None)

# ## ###

Clone this wiki locally