diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 3da108aab8..759b13d68f 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -263,12 +263,20 @@ define(function() { if ($(selection.baseNode).parents('.post-content').length > 0) { var snippet = selection.toString(); - if (snippet.length > 0) selectionText = '> ' + snippet.replace(/\n/g, '\n> '); + if (snippet.length > 0) { + selectionText = '> ' + snippet.replace(/\n/g, '\n> '); + } + } + + var username = '', + post = $(this).parents('li[data-pid]'); + if(post.length) { + username = '@' + post.attr('data-username') + ' '; } if (thread_state.locked !== '1') { require(['composer'], function(cmp) { - cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' : ''); + cmp.push(tid, null, null, selectionText.length > 0 ? selectionText + '\n\n' + username : '' + username); }); } });