Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly process update of chats without accessHash #62

Open
Kaffeine opened this issue Dec 30, 2018 · 0 comments
Open

Properly process update of chats without accessHash #62

Kaffeine opened this issue Dec 30, 2018 · 0 comments
Milestone

Comments

@Kaffeine
Copy link
Owner

A chat object from Updates typically has a subset of Chat properties from that of GetDialogs.
Especially an object from Updates has no AccessHash and currently it breaks any further access to that chat.

Updates received after GetDialogs override accessHash making the chat inaccessible. We have to properly process such Updates and probably update only the needed values.

Update:

TLUpdates(Updates) {
    updates: QVector(TLUpdate(UpdateEditChannelMessage) {
        message: TLMessage(Message) {
            flags: 58560
            id: 277
            toId: TLPeer(PeerChannel) {
                channelId: 1374347484
            }
            date: 1546154527
            message: <text>
            replyMarkup: TLReplyMarkup(ReplyInlineMarkup) {
                rows: QVector(TLKeyboardButtonRow(KeyboardButtonRow) {
                    buttons: QVector(TLKeyboardButton(KeyboardButtonCallback) {
                        text: 1 317
                        data: 73656e645f7265616374696f6e5f30
                    }, TLKeyboardButton(KeyboardButtonCallback) {
                        text: 2 2.3K
                        data: 73656e645f7265616374696f6e5f31
                    }, TLKeyboardButton(KeyboardButtonCallback) {
                        text: 3 266
                        data: 73656e645f7265616374696f6e5f32
                    })
                })
            }
            entities: QVector(TLMessageEntity(MessageEntityTextUrl) {
                offset: 57
                length: 5
                url: http://t.me/address/111
            })
            views: 999
            editDate: 1546203087
        }
        pts: 22222
        ptsCount: 1
    })
    users: QVector()
    chats: QVector(TLChat(Channel) {
        flags: 4192
        id: 1374347484
        title: Chat title
        username: chatname
        photo: TLChatPhoto(ChatPhoto) {
            photoSmall: TLFileLocation(FileLocation) {
                dcId: 2
                volumeId: 235137777
                localId: 266666
                secret: 7354674039851243333
            }
            photoBig: TLFileLocation(FileLocation) {
                dcId: 2
                volumeId: 235134444
                localId: 264444
                secret: 11777733401610977766
            }
        }
        date: 1514566666
        version: 0
    })
    date: 1546207777
    seq: 0
}

Typical chat object in the getDialogs respond:


TLChat(Channel) {
        flags: 8288
        id: 1007454380
        accessHash: 12585072710627688359
        title: Reddit
        username: RedditTop
        photo: TLChatPhoto(ChatPhoto) {
            photoSmall: TLFileLocation(FileLocation) {
                dcId: 2
                volumeId: 713315988
                localId: 61305
                secret: 17238258621322230518
            }
            photoBig: TLFileLocation(FileLocation) {
                dcId: 2
                volumeId: 713315988
                localId: 61307
                secret: 429123949706685596
            }
        }
        date: 1527080586
        version: 0
    }
@Kaffeine Kaffeine added this to the 0.2.0 milestone Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant