[WMTech] Double Post Merge

[WMTech] Double Post Merge 1.3.1

No permission to download
  • Thread starter Thread starter Syndol
  • Start date Start date
Syndol updated Double Post Merge with a new update entry:

Version 1.0.3

What's new:
  • Fixed possible issue with tag formatter. Although I could not duplicate the reported issue, I have cleaned out the code a little and it seems to have helped.
Upgrade Instructions:
  1. Upload the file 'Upload/library/DoublePost/BbCode/Formatter/Base.php' to your server overwriting the old one.
  2. Optional (to display correct version) - Upgrade the addon-DoublePost_103.xml

Read the rest of this update entry...
 
Users who do not have the permission to upload attachments can bypass the double post prevention since they won't have the attachment_hash hidden input included when they reply. So the getAttachmentCountByHash method is going to count all the temp_hash values with an empty string, which will most likely always be higher than the max attachment count. Maybe you can just wrap this whole bit in an if statement, what I simply did:
PHP:
if ($attachmentHash = $this->_input->filterSingle('attachment_hash', XenForo_Input::STRING))
{
    $attachmentHandler = $this->getModelFromCache('XenForo_Model_Attachment')->getAttachmentHandler('post');
    $maxAttachments = $attachmentHandler->getAttachmentCountLimit();
    $lastPostAttachmentCount = $postModel->getAttachmentCountByPostId($thread['last_post_id']);
    $newPostAttachmentCount = $postModel->getAttachmentCountByHash($attachmentHash);
   
    if (($newPostAttachmentCount + $lastPostAttachmentCount) > $maxAttachments)
    {
        return parent::actionAddReply(); // attachments will bring post above allowed limit
    }
}

That avoids having this issue and also reduces the number of queries and function calls when you know the user doesn't have permission.

BTW, any chance of using jQuery for the double post instead of reloading the page?
 
Users who do not have the permission to upload attachments can bypass the double post prevention since they won't have the attachment_hash hidden input included when they reply. So the getAttachmentCountByHash method is going to count all the temp_hash values with an empty string, which will most likely always be higher than the max attachment count. Maybe you can just wrap this whole bit in an if statement, what I simply did:
Good catch. Thanks for reporting. Will update shortly.
BTW, any chance of using jQuery for the double post instead of reloading the page?
Not anytime soon I'm afraid.
 
Syndol updated Double Post Merge with a new update entry:

Version 1.0.4

What's new:
  • Fixed a bug that allowed users who do not have permission to upload attachments to skip the double post check.
Upgrade Instructions:
  1. Upload the file 'Upload/library/DoublePost/ControllerPublic/Thread.php' to your server overwriting the old one.
  2. Upload the file 'Upload/library/DoublePost/Model/Post.php' to your server overwriting the old one.
  3. Optional (to display correct version) - Upgrade the addon-DoublePost_104.xml

Read the rest of this update entry...
 
Syndol updated Double Post Merge with a new update entry:

Version 1.0.5

What's new:
  • Fixed a bug that deferred the image and media count checks to the datawriter.
Upgrade Instructions:
  1. Upload the file 'Upload/library/DoublePost/ControllerPublic/Thread.php' to your server overwriting the old one.
  2. Optional (to display correct version) - Upgrade the addon-DoublePost_105.xml
Sorry for the inconvenience.

Read the rest of this update entry...
 
Just updated to 1.0.5, and that solved the odd issue where only admins' posts were merged, because only admins could use attachments. :)
 
Could you hide the DOUBLEPOST BBCode tag when no text is set for that? I'd rather not have anything, and that BBCode tag shows to Tapatalk users when browsing.
 
It seems as though our doublepost addon works halfway.
It recognizes a doublepost but the bbcode fails to work.

[DOUBLEPOST=1345954388][/DOUBLEPOST]Thread title is so wrong! OOPS!
 
Ask Jake Bunce he knows the answer.
Kidding aside, do you have any BB Code add-ons installed?
Please see this post and the two after that.
 
Should the option titled "Maximum Message Length" actually be named "Minimum Message Length"?

What this option seems to do is if the message you are about to post is 500 characters or less (assuming that's what you set the option to) it will be merged with your previous post if you are double posting. If you post 501 characters it will not be merged. You could actually post 10 consecutive messages with 500 characters and they would all be merged to that one post (assuming the 5000 characters does not go over your total limit in default XF message options).

When I think of "Maximum Message Length", what I thought it would do is check the combined message length of the previous post and the post you're making now and avoid merging the post if the total message length with the merged post would exceed that value. For example, with the same 500 character length, I make a post that is 150 characters and submit my post. Now I double post with another 150 characters, total is now 300 (probably more since it counts the doublepost bbcode?), post is merged. I double post again, post is merged with 450 total chars. Finally this time I double post again, but it will not be merged because the total length would exceed 500 chars. Does it make more sense for this to be called Maximum Message Length and the current existing feature as Minimum Message Length? Ironically I was looking for that exact feature, any chance of it being added?
 
Hi Despair,

Thanks for the feedback.
I will only consider adding such a feature if enough people are interested in it as I'm not sure how many actually require limiting the merging of posts in such a cumulative manner.
If you have a user that continuously replies to his own posts then I think you are facing a bigger issue than the final total sum of characters :whistle:
 
Hmm, a couple of other potential issues I noticed were that users who have edit post permissions and are aware of the doublepost bbcode can easily remove or alter them. If they realise the doublepost dates are taken from the timestamp in the bbcode they could set timestamps to any numbers and create results such as double post merged in year 2038 or year 1927, etc. One other issue I could see is if you have some sort of grace editing time for a post. I'm not using one, but I imagine what a user could do is bypass this grace editing time (depending on your settings), by double posting with could change the timestamp and then proceed to editing. Since the dates aren't stored in the database I'm guessing not much can be done about this, but just thought I'd throw it out there in case you think of an alternative way.
 
What you say is true, however, if you save the date in the database you will then have to insert text into the post content of each double post once they are fetched, which is not ideal.
Obviously this add-on is not perfect but it was the best I could create at the time. Even if I could think of a way to perfect it and prevent the system from edit abuse, I doubt I could find the time to rewrite it right now. Sorry.
 
I will only consider adding such a feature if enough people are interested in it as I'm not sure how many actually require limiting the merging of posts in such a cumulative manner.
Ah okay, I don't think anyone is interested except me then. :p At least not yet.

If you have a user that continuously replies to his own posts then I think you are facing a bigger issue than the final total sum of characters :whistle:
Hehe, well it's not as if the person is talking to themselves. I think it's mostly the case where people forget to add something to their post and just end up posting again instead of editing their original post.

What you say is true, however, if you save the date in the database you will then have to insert text into the post content of each double post once they are fetched, which is not ideal.
Obviously this add-on is not perfect but it was the best I could create at the time. Even if I could think of a way to perfect it and prevent the system from edit abuse, I doubt I could find the time to rewrite it right now. Sorry.
No need to apologise, this is already a free addon so I don't expect every little feature to be added (you can't even expect that with paid addons). :) Maybe I will play around with the code, if that is okay with you, I won't be redistributing it or anything like that, just adjusting it to my own needs. I might just leave it the way it is, as when I think about it, I don't really have such important content that would require preventing these issues 100%, it's just my picky side taking over again. :eek:
 
Feel free to modify the code.
As this is a free add-on, you are welcome to share any modified versions you make.
 
Hello i have another question , one of my admin pm me that everytime she posted a new reply on the same thread it always merged to the first one. I'm not sure if it's related to the double post merge ads on that i also installed or it is the permission that i set in the node list ?

Should i choose unlimited in the group permission to the node list? or inherit?
screenshot20130311at218.png


Im really not sure if that causes the problem because a while ago i set the group permission to unlimited. Looking forward for the answer thanks!
 
It definitely seems to be the Double Post Merge add-on causing it.

If you set the time limit to unlimited then double posts will always be merged regardless of the length of time between the posts.

You would normally only set it to around 60 minutes or so.
 
1. It doesn't merge when a user post by using mobile app Forum Runner or Tapatalk, right?


2. Found a permissions Bug. When I am in 2 permission groups (Administrator & User), always the higher number of the setting is taken for Double Post Merge time limit.


Double Post Merge time limit (minutes) - beyond this limit the post will not be merged, Unlimited = always merge:
When I set this to 1 minute for group User and 5 minutes for group Administrator, it merges always after 5 minutes. when i set it to 5 minutes for administrator and 1 minute for User, it also merges after 5 minutes. but the addon should check for the group-rank-ladder, which one takes priority. and of course, if not yet implemented, first check individual permissions on forum-nodes and specific-user-global-permissions (I don't know, if individual permissions are already prioritized in this addon).

Additional information, probably helpful:
My user account (superadmin, number 1 of all members) is in 2 permissiongroups: Administrator (my primary group, group database number 3) and User (my secondary group, group database number 2)
 
I already did this but still it merged all of my reply from the thread i posted?
Do i need to set the merging or group permission to "inherit" or unlimited?
I'm really confused! :(
 
Top Bottom