mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
@@ -8,8 +8,6 @@ var load_more_enabled = true;
|
||||
// since the last time that we ran load_more_messages(), we do
|
||||
// not load_more_messages().
|
||||
|
||||
// used for our URL rewriting in insert_new_messages
|
||||
var humbug_images_re = new RegExp("https://humbug-user-uploads.s3.amazonaws.com/([^\"]+)", 'g');
|
||||
exports.recent_private_messages = [];
|
||||
|
||||
exports.get = function get(message_id) {
|
||||
@@ -199,10 +197,6 @@ exports.add_messages = function add_messages(messages, msg_list, opts) {
|
||||
|
||||
opts = _.extend({messages_are_new: false, delay_render: false}, opts);
|
||||
|
||||
_.each(messages, function (msg) {
|
||||
msg.content = msg.content.replace(humbug_images_re, "/user_uploads/unk/$1");
|
||||
});
|
||||
|
||||
loading.destroy_indicator($('#page_loading_indicator'));
|
||||
$('#first_run_message').remove();
|
||||
|
||||
|
||||
@@ -1198,8 +1198,6 @@ class AttachmentTest(ZulipTestCase):
|
||||
self.assertFalse(Message.content_has_attachment('yo http://foo.com'))
|
||||
self.assertTrue(Message.content_has_attachment('yo\n https://staging.zulip.com/user_uploads/'))
|
||||
self.assertTrue(Message.content_has_attachment('yo\n /user_uploads/1/wEAnI-PEmVmCjo15xxNaQbnj/photo-10.jpg foo'))
|
||||
self.assertTrue(Message.content_has_attachment('https://humbug-user-uploads.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
self.assertTrue(Message.content_has_attachment('https://humbug-user-uploads-test.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
|
||||
self.assertFalse(Message.content_has_image('whatever'))
|
||||
self.assertFalse(Message.content_has_image('yo http://foo.com'))
|
||||
@@ -1207,15 +1205,11 @@ class AttachmentTest(ZulipTestCase):
|
||||
for ext in [".bmp", ".gif", ".jpg", "jpeg", ".png", ".webp", ".JPG"]:
|
||||
content = 'yo\n /user_uploads/1/wEAnI-PEmVmCjo15xxNaQbnj/photo-10.%s foo' % (ext,)
|
||||
self.assertTrue(Message.content_has_image(content))
|
||||
self.assertTrue(Message.content_has_image('https://humbug-user-uploads.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
self.assertTrue(Message.content_has_image('https://humbug-user-uploads-test.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
|
||||
self.assertFalse(Message.content_has_link('whatever'))
|
||||
self.assertTrue(Message.content_has_link('yo\n http://foo.com'))
|
||||
self.assertTrue(Message.content_has_link('yo\n https://example.com?spam=1&eggs=2'))
|
||||
self.assertTrue(Message.content_has_link('yo /user_uploads/1/wEAnI-PEmVmCjo15xxNaQbnj/photo-10.pdf foo'))
|
||||
self.assertTrue(Message.content_has_link('https://humbug-user-uploads.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
self.assertTrue(Message.content_has_link('https://humbug-user-uploads-test.s3.amazonaws.com/sX_TIQx/screen-shot.jpg'))
|
||||
|
||||
def test_claim_attachment(self):
|
||||
# type: () -> None
|
||||
|
||||
@@ -75,8 +75,6 @@ TERMS_OF_SERVICE = 'corporate/terms.md'
|
||||
# TOS_VERSION = '1.0'
|
||||
# FIRST_TIME_TOS_TEMPLATE = 'zulipchat_migration_tos.html'
|
||||
|
||||
# Legacy zulip.com bucket used for old-style S3 uploads.
|
||||
S3_BUCKET="humbug-user-uploads"
|
||||
# Buckets used for Amazon S3 integration for storing files and user avatars.
|
||||
S3_AUTH_UPLOADS_BUCKET = "zulip-user-uploads"
|
||||
S3_AVATAR_BUCKET="humbug-user-avatars"
|
||||
|
||||
@@ -107,7 +107,6 @@ DEFAULT_SETTINGS = {'TWITTER_CONSUMER_KEY': '',
|
||||
'EMAIL_GATEWAY_EXTRA_PATTERN_HACK': None,
|
||||
'S3_KEY': '',
|
||||
'S3_SECRET_KEY': '',
|
||||
'S3_BUCKET': '',
|
||||
'S3_AVATAR_BUCKET': '',
|
||||
'LOCAL_UPLOADS_DIR': None,
|
||||
'MAX_FILE_UPLOAD_SIZE': 25,
|
||||
|
||||
Reference in New Issue
Block a user