Oct 29, 2012 at 11:01 PM
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Pronouns: he/him
Consider this code:
If a user has just posted, and they double post, make that post an edit instead. Is this possible?
I know double posting has not been a problem recently, but this would be a nice feature.
Code:
function publishPost($postMessage, $thisPoster, $lastPoster) {
$flag = $lastPoster === $thisPoster;
if ($flag) {
$lastPost.edit(getContents($lastPost) . $postMessage);
} else {
$newPost = $makePost($postMessage);
}
return $flag ? $lastPost : $newPost;
}
If a user has just posted, and they double post, make that post an edit instead. Is this possible?
I know double posting has not been a problem recently, but this would be a nice feature.