tinode / chat

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
GNU General Public License v3.0
12.03k stars 1.88k forks source link

Timestamp of last contact for subscription #76

Closed ghost closed 6 years ago

ghost commented 6 years ago

I'd like a simple way to sort my subscriptions (conversations) when first receiving the information on them. Currently there is only the updated timestamp which is only changed when the subscription is actually changed. The only way (I can think of) to get this information is to get sub info to get the last message, then grab that using the sub again for the topic with a single ID for the message:

sub: {
    topic: "usr3424rwefsdf",
    what: "get",
    get: {
        since: "<lastId>",
        limit: 1
    }
}

It would make sense to receive the last contact date in the info for the initial me subscription. I don't have much experience with Go but I'd like to contribute as much as possible. I am writing an angular4 implementation for your chat and I plan on open sourcing it once completed.


sub: {
                topic: 'me',
                get: {
                    what: "desc sub data info", // info would also include last contacted timestamp.
                }
            }
or-else commented 6 years ago

I agree that this feature is useful. I wanted to add it but it was not a priority. I can certainly prioritize it. When I add it, will you be able to test it on devel branch?

ghost commented 6 years ago

I can, Is there a way to specify branching with go get from the dockerfile?

or-else commented 6 years ago

Previously it was impossible: docker ran go get and there was no way to specify a branch with go get. The good news is that I just changed the way dockerfiles are constructed (see devel). Now I can cut a pre-release from devel then build docker images for it.

or-else commented 6 years ago

The feature is available in 0.14.6-rc1 as touched. You can use pre-built docker images: e.g. for MySQL docker pull tinode/tinode-mysql:0.14.6-rc1

ghost commented 6 years ago

Seems to be working as expected on the docker image. I'll post any bugs to this issue if they arise!

Thanks!

or-else commented 6 years ago

Everything seems to be working as expected. Closing this issue. Thanks.