loadedPosts[postId] = true;
$.getJSON("getPost.ajax", { "post" : postId }, function(data, textStatus) {
if ((data != null) && data.success) {
- if (!isIndexPage() && !(isViewSonePage() && (getShownSoneId() == data.post.sone))) {
+ if (!isIndexPage() && !(isViewSonePage() && ((getShownSoneId() == data.post.sone) || (getShownSoneId() == data.post.recipient)))) {
return;
}
var firstOlderPost = null;
if (firstOlderPost != null) {
newPost.insertBefore(firstOlderPost);
} else {
- $("#sone .post:last").append(newPost);
+ $("#sone #posts").append(newPost);
}
ajaxifyPost(newPost);
newPost.slideDown();
ajaxifyReply(newReply);
newReply.slideDown();
setActivity();
+ return false;
});
}
});
registerInputTextareaSwap("#sone #post-message input[name=text]", defaultText, "text", false, false);
$("#sone #post-message").submit(function() {
text = $(this).find(":input:enabled").val();
- $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "recipient": $("#sone #sone-id").text(), "text": text }, function(data, textStatus) {
+ $.getJSON("createPost.ajax", { "formPassword": getFormPassword(), "recipient": getShownSoneId(), "text": text }, function(data, textStatus) {
if ((data != null) && data.success) {
loadNewPost(data.postId);
}