Commit Graph

24 Commits

Author SHA1 Message Date
Rhea Parekh
48640fd28f slack importer: Suppress logger output from the unit tests. 2018-02-08 16:21:35 -08:00
Rhea Parekh
83a7fd84ab slack importer: Import primary owner user first.
According to https://get.slack.help/hc/en-us/articles/201912948-Owners-and-Administrators,
only one Primary owner of a slack organsation exists. This allocates the first id
to the Primary owner and hence makes sure that the primary owner is imported first.
Added tests for the same.
2018-02-06 14:48:30 -08:00
Rhea Parekh
052e3e1540 slack importer: Change organization admin mappings.
Map 'Primary owner', 'owner' and 'admin' to 'organization admin'.
Added tests for the same.
2018-02-06 14:48:30 -08:00
Rhea Parekh
b3b6023230 slack importer: Always map 'is_staff' to false in user data.
"staff" is only for server administrators, which doesn't exist in Slack.
Hence, this should always be false.
2018-02-06 14:48:29 -08:00
Rhea Parekh
eb7a9675a4 slack importer: Add unit tests. 2018-02-05 14:46:39 -08:00
Rhea Parekh
2b11bff9ad slack importer: Refactor script for easier unit tests.
This is to break the bigger functions into smaller
ones and hence, makes unit testing easier.

Also includes renaming the stream's topic name to 'from slack'.
2018-02-05 14:46:39 -08:00
Vishnu Ks
035d3c5e97 upload: Remove UserProfile field for old per-user quota. 2018-01-29 16:06:11 -08:00
Rhea Parekh
5b1e9f8181 slack importer: correct the implementation of unzipping slack data file.
Slack zip file unzips in the same folder.
2018-01-23 10:01:15 -05:00
Rhea Parekh
845a8d63bf slack importer: Prevent id clashes for import in an active db.
Previously we had a problem of id clashes while importing converted
slack data into an existing zulip instance with realms which are actively
populating the database.

This counts the total objects to be imported and does a db transaction
to increase the SEQUENCE number for that table by that number,
and hence allocates a range of ids for the to be converted slack data
objects.
2018-01-23 10:01:15 -05:00
Rhea Parekh
7153d20205 slack importer: append Message id from the db. 2018-01-17 11:46:27 -05:00
Rhea Parekh
58f1f0e13e slack importer: append Recipient id from the db.
Recipient id should be updated from the database,
otherwise there will be foreign key clashes.
2018-01-17 11:46:27 -05:00
Rhea Parekh
c86411d9a2 slack importer: Move message conversions to a new module. 2018-01-17 09:38:53 -05:00
Rhea Parekh
c1d336f5d1 slack importer: Refactor checking for availability of realm subdomain. 2018-01-17 09:38:53 -05:00
Rhea Parekh
b583f1f0ff slack importer: Add regex for markdown mapping.
* For strikethrough formatting: Slack's '~strike~' to Zulip's '~~strike~~'.
    * For bold formatting: Slack's '*bold*' to Zulip's '**bold**'.
    * For italic formatting: Slack's '_italic_' to Zulip's '*italic*'.
    * For mentioning formatting: Slack's <@slack_id|short_name> to Zulip's @**full_name**.
    * Checking links.
2018-01-08 08:05:50 -05:00
Rhea Parekh
a6e0bcd5f6 Slack importer: Map messages and usermessages. 2018-01-08 08:05:50 -05:00
Rhea Parekh
24a86a524b slack importer: Quiet the unzip command. 2018-01-08 08:05:50 -05:00
Rhea Parekh
4019a456d1 slack importer: Rename messages file.
Rename messages file from '/message-000001.json' to
'/messages-000001.json'
2018-01-08 08:05:50 -05:00
Rhea Parekh
400c968b0e slack importer: Remove unnecessary comment. 2018-01-08 08:05:50 -05:00
Rhea Parekh
c875428a83 slack importer: Extract get_user_full_name() helper. 2018-01-08 08:05:50 -05:00
Vishnu Ks
5cadc6365a slack importer: Extract data into directory of zip file.
Currently the zip file is extracted to the root of
zulip directory no matter where the the zip file.
The extracted data is not useful after running the command
which pollutes the zulip directory. It make more sense to
extract it to the same directory of zip file especially
when the zip file gets downloaded to /temp like in the tests.
2018-01-07 09:50:27 -05:00
Aastha Gupta
daf86eb664 settings: Add "text" option to emoji_set model.
We no longer have a special UI setting and model
field ("emoji_alt_code") for saying users want text-only
emojis.  We now instead make "text" be a fifth choice
for "emojiset".

Fixes #7406
2018-01-02 14:55:01 -05:00
YJDave
fa44d2ea69 settings: Remove autoscroll_forever setting.
Fixes #6845
2018-01-02 10:35:49 -05:00
Rhea Parekh
cd332a7f59 Slack importer: Append ids to the existing ids in the database.
For import with the condition `--import-into-nonempty`, the ids
of the mapped data will be appended to the existing ids in the
database.
2017-12-27 07:50:53 -05:00
Rhea Parekh
5b37c5562b Slack importer: Add the slack to zulip data conversion files. 2017-12-27 07:50:53 -05:00