mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
Send some messages to warm up the first user in a realm.
(imported from commit b4d92d474b27c9a0eabf99576a0f441a7d919106)
This commit is contained in:
@@ -184,6 +184,20 @@ var fake_messages = [
|
||||
}
|
||||
];
|
||||
|
||||
function send_delayed_stream_message(stream, topic, content, delay) {
|
||||
setTimeout(function () {
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
url: '/json/tutorial_send_message',
|
||||
type: 'POST',
|
||||
data: {'type': 'stream',
|
||||
'recipient': stream,
|
||||
'topic': topic,
|
||||
'content': content}
|
||||
});
|
||||
}, delay * 1000); // delay is in seconds.
|
||||
}
|
||||
|
||||
function hide_app_alert() {
|
||||
$('#alert-bar-container').slideUp(100);
|
||||
}
|
||||
@@ -336,6 +350,17 @@ function finale() {
|
||||
if (stream_data.in_home_view(page_params.notifications_stream)) {
|
||||
narrow.activate([["stream", page_params.notifications_stream]]);
|
||||
}
|
||||
|
||||
if (page_params.first_in_realm) {
|
||||
if (stream_data.in_home_view("engineering")) {
|
||||
send_delayed_stream_message("engineering", "projects", "This is a message on stream **engineering** with the topic **projects**. Practice sending sending some messages here, or creating a new topic.", 10);
|
||||
send_delayed_stream_message("engineering", "projects", "You might also enjoy:\n* Our lightweight formatting\n* emoji :thumbsup:\n* Our [desktop and mobile apps](/apps)", 15);
|
||||
}
|
||||
|
||||
if (stream_data.in_home_view("social")) {
|
||||
send_delayed_stream_message("social", "cute animals", "This is a message on stream **social** with the topic **cute animals**. Try uploading or pasting in some pictures. Here's a [guinea pig](https://humbug-user-uploads.s3.amazonaws.com/byqgM1qjol1mzje_KzeNRT5F/guinea.jpg) to get you started:", 25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reply() {
|
||||
|
||||
Reference in New Issue
Block a user