Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Feature Request?

I like this plugin as it removes the need for me to do this manually. I just have 2 things.

1) the plugin doesn't notify the user he has a message (just an email notification that could/might end up in the spam folder)
2) it'd be neat if there was a way to change the default user who sends the message to another admin/dummy account.

Otherwise, I like this a lot. Thanks!

Comments

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @killingtree: Good requests. Would like to see this also. :)

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • beschizzabeschizza New
    edited April 2014

    If you add this line to the plugin's default.php along with the other queries it runs, it will add an INBOX notification:

    $this->Construct->Query("UPDATE `". $this->Px ."User` SET CountUnreadConversations = 1 WHERE UserID =". $UserID ."");

    However, I doubt that triggers a proper general notification for a PM -- there's a more this plugin should be doing to produce a properly formed PM that it doesn't.

    And there's a serious-ish bug: the serialized list of conversation participants it puts in will usually be broken because it assumes the UserID character length for each participant is always 1.

    A quick, hacky fix: Find the line

    'a:2:{i:0;s:1:\"". $UserID ."\";i:1;s:2:\"1\";}', 

    and change it to

    'a:2:{i:0;s:".strlen($UserID).":\"". $UserID ."\";i:1;s:1:\"1\";}', 

    At least creates the intended serialized values, so long as the sending UserID is one character long.

    Finally, the sender of the PM is hardcoded as UserID 1. If you want to change this, it's in line 75, the third-last value. And you'd have to update that line with the serialized array of participants too, and wherever else this plugin has it.

    This is a great idea for a plugin, but it needs an overhaul by someone who understands garden much better than me :dizzy_face:

  • beschizzabeschizza New
    edited April 2014

    Another bug. It only creates one row in UserConversation, when there should be two -- one for each participant in a conversation. The result is a message that has no sender in the inbox, and the system thinking it is a conversation with oneself.

    find the line

    this->Construct->Query("INSERT INTO `". $this->Px ."UserConversation` (`UserID`, `ConversationID`, `CountReadMessages`, `LastMessageID`, `DateLastViewed`, `DateCleared`, `Bookmarked`, `Deleted`) VALUES (". $UserID .", ". $cid .", 0, ". $mid .", NULL, NULL, 0, 0);");

    and add after it a copy of it (don't edit it!), changing the UserID value to the UserID you want to be the sender,

    $this->Construct->Query("INSERT INTO `". $this->Px ."UserConversation` (`UserID`, `ConversationID`, `CountReadMessages`, `LastMessageID`, `DateLastViewed`, `DateCleared`, `Bookmarked`, `Deleted`) VALUES (2, ". $cid .", 0, ". $mid .", NULL, NULL, 0, 0);");

    So you basically end up with corresponding UserConversation entries for each user, which is apparently what is needed to create a legit conversation in vanilla.

Sign In or Register to comment.