mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 14:13:21 +00:00
.
This commit is contained in:
parent
803ef68576
commit
19b28afae5
@ -377,7 +377,7 @@ function openAttachmentsGallery(msg) {
|
|||||||
function closeAttachmentsPreview() {
|
function closeAttachmentsPreview() {
|
||||||
$('#attachment-preview').hide();
|
$('#attachment-preview').hide();
|
||||||
$('#message-list').show();
|
$('#message-list').show();
|
||||||
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
|
scrollToMessageListBottom();
|
||||||
if (activeChat) {
|
if (activeChat) {
|
||||||
chats[activeChat].attachments = null;
|
chats[activeChat].attachments = null;
|
||||||
}
|
}
|
||||||
@ -1061,11 +1061,7 @@ function showChat(pub) {
|
|||||||
});
|
});
|
||||||
lastSeenTimeChanged(pub);
|
lastSeenTimeChanged(pub);
|
||||||
chats[pub].setMyMsgsLastSeenTime();
|
chats[pub].setMyMsgsLastSeenTime();
|
||||||
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
|
scrollToMessageListBottom();
|
||||||
$('#message-view img').on('load', () => {
|
|
||||||
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
|
|
||||||
});
|
|
||||||
setTimeout(() => $('#message-view img').off('load'), 500);
|
|
||||||
chats[pub].setMyMsgsLastSeenTime();
|
chats[pub].setMyMsgsLastSeenTime();
|
||||||
setTheirOnlineStatus(pub);
|
setTheirOnlineStatus(pub);
|
||||||
setDeliveredCheckmarks(pub);
|
setDeliveredCheckmarks(pub);
|
||||||
@ -1137,6 +1133,7 @@ function addMessage(msg, chatId) {
|
|||||||
if (a.type.indexOf('image') === 0 && a.data) {
|
if (a.type.indexOf('image') === 0 && a.data) {
|
||||||
var img = $('<img>').attr('src', a.data).click(() => { openAttachmentsGallery(msg); });
|
var img = $('<img>').attr('src', a.data).click(() => { openAttachmentsGallery(msg); });
|
||||||
msgContent.prepend(img);
|
msgContent.prepend(img);
|
||||||
|
img.one('load', scrollToMessageListBottom);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1216,6 +1213,10 @@ var askForPeers = _.once(pub => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function scrollToMessageListBottom() {
|
||||||
|
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
|
||||||
|
}
|
||||||
|
|
||||||
function addChat(channel) {
|
function addChat(channel) {
|
||||||
var pub = channel.getId();
|
var pub = channel.getId();
|
||||||
if (chats[pub]) { return; }
|
if (chats[pub]) { return; }
|
||||||
@ -1243,7 +1244,7 @@ function addChat(channel) {
|
|||||||
chats[pub].latest = msg;
|
chats[pub].latest = msg;
|
||||||
var text = msg.text || '';
|
var text = msg.text || '';
|
||||||
if (msg.attachments) {
|
if (msg.attachments) {
|
||||||
text = '[attachment]: ' + text;
|
text = '[attachment]' + (text.length ? ': ' + text : '');
|
||||||
} else {
|
} else {
|
||||||
text = msg.text;
|
text = msg.text;
|
||||||
}
|
}
|
||||||
@ -1275,7 +1276,7 @@ function addChat(channel) {
|
|||||||
} else if (!chats[pub].uuid) {
|
} else if (!chats[pub].uuid) {
|
||||||
$('#not-seen-by-them').slideDown();
|
$('#not-seen-by-them').slideDown();
|
||||||
}
|
}
|
||||||
$('#message-view').scrollTop($('#message-view')[0].scrollHeight - $('#message-view')[0].clientHeight);
|
scrollToMessageListBottom();
|
||||||
}
|
}
|
||||||
notify(msg, info, pub);
|
notify(msg, info, pub);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user