Skip to content

Develop Channel.Type.FileList #19

@Kaffeine

Description

@Kaffeine

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions