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

Develop Channel.Type.FileList #19

Open
Kaffeine opened this issue Aug 31, 2017 · 0 comments
Open

Develop Channel.Type.FileList #19

Kaffeine opened this issue Aug 31, 2017 · 0 comments

Comments

@Kaffeine
Copy link
Member

Kaffeine commented Aug 31, 2017

Channel.Type.FileList

A channel type for listing files. Can be used to list files of a conversation with a peer or to list a history of peer pictures.

Objects implementing this interface must also implement: Channel.

Use cases

List files shared in a conversation

  • Client makes Connection.Interface.Requests.CreateChannel() call with details { 'targetHandle': '1', 'targetHandleType': '2' }
  • CM creates a FileList Channel
  • Client calls the FileListChannel List() method
  • CM fetch a part of filelist
  • FileListChannel emits GotFiles() with argument
[
   {
      "file-type":"image",
      "sender-id":"user12345",
      "caption":"My new device",
      "timestamp":12345678,
      "thumbnail":"FFD8 ... FFD9",
      "file-ids":[
         {
            "file-id":"000011235624512346457643123",
            "content-type":"image/png",
            "width":"1920",
            "height":"1080"
         },
         {
            "file-id":"000011235624512346452165212",
            "content-type":"image/png",
            "width":"1024",
            "height":"768"
         }
      ]
   },
   {
      "file-type":"image",
      "sender-id":"user12345",
      "caption":"My old device",
      "timestamp":12346678,
      "thumbnail":"FFD8 ... FFD9",
      "file-ids":[
         {
            "file-id":"000011235624512345122354121",
            "content-type":"image/png",
            "width":"1920",
            "height":"1080"
         },
         {
            "file-id":"000011235624512346452161234",
            "content-type":"image/png",
            "width":"1024",
            "height":"768"
         }
      ]
   }
]
  • Client shows to user the list of images
  • User choose an image
  • Client download the image by file-id via Channel.Type.FileTransfer requested with argument ( "file-id":"000011235624512345122354121" )

Types

File_Attributes_List — a(a{sv})

Methods

  • List (a{sv}: Filters) -> nothing
  • More () -> nothing
  • Stop () -> nothing

Signals

  • GotFiles (a(a{sv}): File_Attributes_List)

Properties

Limit — u (Read only, Immutable, Sometimes requestable)

FilterKeys — as

Possible (optional) keys:

  • mime-types - as (string list).

Links

See also: https://telegram.org/blog/shared-files

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