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.

[Idea] PM box in the panel

rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one"NY ✭✭✭
edited August 2015 in Vanilla 2.0 - 2.8

I saw the Van2Shout plugin where the shout box is placed in the panel and thought that it would be nice to place the Vanilla conversations (private messages) in the panel (we don't use Van2Shout nor do we want to).
Anyone has done that? Any insights into this?

Tagged:
«1

Comments

  • hgtonighthgtonight ∞ · New Moderator

    You would have to create a few custom modules.

    This could be cool.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Just thinking out loud (very risky;-) - when I click on the envelope on the top right (on my VBS3 theme) the narrow display of the Inbox is exactly what I wanted to appear in the side panel. How can that be leveraged?

  • peregrineperegrine MVP
    edited August 2015

    I can hear you thinking over here. can you think a little lower in volume :bleep_bloop:

    all it is is the output messages/all with css rules.

    the thing is, it is not automatically updated.

    when you view conversations - it requires a screen refresh to see new messages so being in the panel doesn't help much unless it were updated, still requires a screen refresh, except its not only displaying discussions, etc, alslo messages (if the messages were updated when someone sent you one, it would be like van2shout)

    perhaps,what you need is van2shout that writes messages to the activity model to go to conversation table

    But I think you could develop this in less than 60 minutes :wink: (it is so easy to estimate other people's time)

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You already have that option to send pm using online now plugin...

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭
    edited August 2015

    @vrijvlinder - Maybe I am misunderstood - the goal was to show the PM dialogs in the narrow panel the same way it pops down when the envelope is clicked. And of course the Online Now plugin list doesn't match the entire users universe.

    @peregrine - If I understood you correctly, the refresh requires a plugin, and van@shout is a good model to mod to get the messages. I will look at it to see what magic does the refresh. I am curios about the code that drives the envelope pull down - it gets to the same data. Not sure where the code is yet.

    As for your time estimate, to make it happen I will need way more than 30 minutes to research so I could stand a chance to meet your challenge;-)

  • hgtonighthgtonight ∞ · New Moderator

    You could create a module that shows your inbox and have an AJAX refresh on the module. It probably wouldn't scale well, but that doesn't mean it can't be done.

    My addon Latest Post List does something similar.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I am thinking over the scalability issue you mentioned - not for my small intranet forum but because I want to contribute back the plugin I will eventually write. I understand the impact of repeatedly checking for any new messages, but why is that any different than the envelope highlighted signaling that one has a new message? That has also to check for new emails. So what's the difference?

  • hgtonighthgtonight ∞ · New Moderator

    @rbrahmson said:
    why is that any different than the envelope highlighted signaling that one has a new message? That has also to check for new emails. So what's the difference?

    The envelope notification is a simple check that reads out a denormalized value from a single db record. The inbox view (what you see when you click on the envelope icon) is a complex query over multiple db tables/records.

    The (naive implementation of the) proposed module would effectively be clicking the inbox view every x minutes.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    So it seems that the optimized way is to check the denormalized value from the single db record, and only if the response indicates a change to do the complex query. Right?

  • hgtonighthgtonight ∞ · New Moderator

    @rbrahmson said:
    So it seems that the optimized way is to check the denormalized value from the single db record, and only if the response indicates a change to do the complex query. Right?

    Yes. Or hook into the existing notification check.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Yea, I need to find where is that piece of code (not just the check but the entire pull-downed inbox). Juggling several things at once right now.

  • peregrineperegrine MVP
    edited August 2015

    @rbrahmson said:
    Yea, I need to find where is that piece of code (not just the check but the entire pull-downed inbox). Juggling several things at once right now.

    peregrine previously said: all it is is the output messages/all

    so since all messages between people are part of the "conversations application" as you will see in the dashboard list of applications.

    look in the application conversations.
    then messages in the link is the clue for the messages controller.
    then the all in the link is the clue for the function all.

    https://github.com/vanilla/vanilla/blob/release/2.1/applications/conversations/controllers/class.messagescontroller.php#L173

    then look at ... ConversationModel->Get2
    https://github.com/vanilla/vanilla/blob/release/2.1/applications/conversations/controllers/class.messagescontroller.php#L191

    which leads here in the Conversations Model ... Get2
    https://github.com/vanilla/vanilla/blob/release/2.1/applications/conversations/models/class.conversationmodel.php

    then look at the views for ideas.

    I still see no advantage to what you propose. it provides nothing easier to me that you can't get with one click and is superfluous most of the time, and when you really want a conversation, you will need to have full fledged adding creating messages etc, but after you create it, I may be swayed.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Thanks @Peregrine. As for the functionality - it's a matter of personal style, I suppose. On the issue of creating message, I intend the list to have a link that opens up the conversation (e.g. myforum/messages/9#latest) for a quick response (possibly via pop up).

    Regarding the existing pulldown, I called Memodule directly (myforum/module/memodule/Inbox) and will monitor (debugit/Eventi) what's going on there just to see what's the process. I may want to leverage existing hooks if I find anything interesting. I'm still in the research mode;-)
    Last but not least - thanks for the pointers.

  • peregrineperegrine MVP
    edited August 2015

    rbrahmson said: I called Memodule directly (myforum/module/memodule/Inbox

    http://vanillaforums.org/module/inboxmodule

    I don't know exactly what you want to do.

    you may want to look at Inbox module.

    you can add modules to a specific asset (e.g. Panel).

    $Sender->AddModule($MyOwnModule,"Panel");

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    @peregrine - thanks again for another pointer. I saw some of that in the module sort plugin.

    To be honest, I started this post as an idea (marked so in the title) with no immediate intent to implement it (too busy right now) and then @hgtonight encouraged the idea ("This could be cool") and you (with humor) challenged me to do it within an hour...

    But as a novice I won't even start coding before researching a bit, ergo the multitude of questions/observations, the feedback of which is helping me tremendously.

    At this stage I'm trying to figure out what drives the pull down narrow inbox when one clicks on the envelope. That is different than the full scale message/all which I think you pointed me to earlier (I did find on my own by phpmysql that the info requires joining the tables).

    When you ask for a precise "what you want to do " I can't precisely answer that - it's a journey of learning and trial and error. .. The general gist is to have a module that shows recent inbox messages with a link to respond to the specific clicked message. Exact look and feel will be dealt with later (possibly css).

    I have to thank you and @hgtonight and @Bleistivt for being able to utter all the above - few weeks ago it was all Greek to me.

  • peregrineperegrine MVP
    edited August 2015

    I think you are up for the challenge, otherwise I wouldn't give you this hint...

    Speaking of leverage, you may want to do a selective recursive asynchonization into the rete mirabile, and then obfuscate that with a refactoring of the crepuscular estivation of the fractory layer to produce the penultimate view. Either way, you should get to the same place along the archimedic principle.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    @rbrahmson said:

    At this stage I'm trying to figure out what drives the pull down narrow inbox when one clicks on the envelope.

    It uses the view at http://vanillaforums.org/messages/popin. The actual JS handling is done via the /js/global.js file.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I looked at the Conversation code in Vanilla and saw how Popin in the Conversation application uses the Get2 function to perform the database access with its joins. I tried to the following in the custom module (lifted from the popin function):

    $Conversations = $this->ConversationModel->Get2(Gdn::Session()->UserID, 0, 5);
    

    I get an error message:

    PHP Fatal error: Call to a member function Get2() on a non-object in ...

    I this indicating that I need to do something special to invoke a public function within the ConversationModel? Or do I have to copy the code from Get2 and do the database access myself within my custom module?

  • peregrineperegrine MVP
    edited August 2015

    You can't open a refrigerator in your bedroom if it isn't there.

    you have to provide code and context. at least a stack trace.

    $this refers to what. (think about it). what object is it referring to. dump it to see.
    you can google $this as it refers to things in OOP.

    see earlier comment http://vanillaforums.org/discussion/comment/233203/#Comment_233203

    the data is the same pretty much all over. the difference is how it is displayed.

    how the data is retrieved is different and the OOP experts may tell you the best way.

    it doesn;t stop you though from producing functioning code which can always be refactored.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    If I understand your comment correctly I cannot invoke Get2 because it is embedded in another application (albeit in "Vanilla" in its expansive meaning ) and so I have to go for the data myself (and use the get2 as sample makes it easy).

    That is what I suspected the error message means. I can live with that but was hoping that OOP would allow for more code reusability. In your metaphor, asking someone to bring me something from the fridge in the kitchen...

    I'll wait a bit to hear from "some OOP experts" to chime in on this.

Sign In or Register to comment.