Import Slack uploads if present in zip archive. (#4088)

* Import Slack uploads if present in zip archive.

This is part 3 of PLT-4280, to support importing file uploads when
importing from Slack. It is assumed the uploads in the zip archive will
be present as per the output of slack-advanced-exporter:

https://github.com/grundleborg/slack-advanced-exporter

If the uploads are not present (ie. this is a vanilla Slack export
archive) uploads are treated in the same way as before this patch,
providing only a link to the upload on Slack's servers.

* Update to new Files API.
Этот коммит содержится в:
George Goldberg
2016-10-12 14:31:05 +01:00
коммит произвёл Harrison Healey
родитель 1b0c1eb3ae
Коммит 5ca05124cf
3 изменённых файлов: 102 добавлений и 5 удалений

Просмотреть файл

@@ -1535,6 +1535,10 @@
"id": "api.slackimport.slack_add_channels.merge",
"translation": "Merged with existing channel: {{.DisplayName}}\r\n"
},
{
"id": "api.slackimport.slack_add_posts.attach_files.error",
"translation": "Encountered error attaching files to post, post_id=%s, file_ids=%v, err=%v"
},
{
"id": "api.slackimport.slack_add_posts.bot.warn",
"translation": "Slack bot posts are not imported yet"
@@ -1551,6 +1555,22 @@
"id": "api.slackimport.slack_add_posts.unsupported.warn",
"translation": "Unsupported post type: %v, %v"
},
{
"id": "api.slackimport.slack_add_posts.upload_file_not_found.warn",
"translation": "No file found in Slack export for file upload message with file ID {{.FileId}}"
},
{
"id": "api.slackimport.slack_add_posts.upload_file_not_in_json.warn",
"translation": "Cannot import file for upload post with no \"file\" section present in export."
},
{
"id": "api.slackimport.slack_add_posts.upload_file_open_failed.warn",
"translation": "Could not open the upload file with ID {{.FileId}} in the export archive with error: {{.Error}}"
},
{
"id": "api.slackimport.slack_add_posts.upload_file_upload_failed.warn",
"translation": "Uploading the file for upload message with file ID {{.FileId}} failed with error: {{.Error}}"
},
{
"id": "api.slackimport.slack_add_posts.user_no_exists.debug",
"translation": "User: %v does not exist!"