Support replying to a thread.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3726 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-12-31 19:01:53 +00:00
parent 4e359c3f5c
commit 3026443c1e
4 changed files with 15 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ var g_data = {
pubs: [],
votes: {},
apps: {},
reply_root: null,
reply_branch: null,
mentions: {},
unread: 0,
};
@@ -121,12 +123,18 @@ window.addEventListener('load', function() {
type: 'post',
text: document.getElementById('post_text').value,
};
if (g_data.reply_root || g_data.reply_branch) {
message.root = g_data.reply_root;
message.branch = g_data.reply_branch;
}
if (Object.keys(g_data.mentions).length) {
message.mentions = Object.values(g_data.mentions);
}
window.parent.postMessage({appendMessage: message}, '*');
document.getElementById('post_text').value = '';
Vue.set(g_data, mentions, {});
g_data.reply_root = null;
g_data.reply_branch = null;
},
ssb_connect: function(connection) {
window.parent.postMessage({connect: connection}, '*');