15

If I expect a comment thread to require several back-and-forths, is there an easy way to take it to chat sooner than the 8th reply (or whenever it is that the site automatically suggests you take it to chat)?

I know I can manually create the chat room and then post a link to it in the comments, I'm just wondering if there is a more convenient way that I'd missed.

2
  • 2
    At this time, there is not... I would suggest creating a new chat room and then posting your own comment saying @User1: let's move this conversation to http://chat.stackexchange.com/room-for-you-and-me or something to that effect.
    – studiohack Mod
    Commented Mar 27, 2012 at 22:50
  • @studiohack: thanks, this helps a lot. =)
    – superuser
    Commented Jul 2, 2012 at 8:09

1 Answer 1

6

Found the relevant code:

var c=this.jDiv.find(".comment-form");

c.find(".discussion-info").length ||
  ($("<div style='margin:12px 0 3px; font-weight:bold' class='discussion-info'>Please avoid extended  discussions in comments. Would you like to <a href='#'>automatically move this discussion to chat?</a></div>")
  .find("a").click(function(a){
    $(this).unbind("click");
    a.preventDefault();
    b.ajax({url:"/posts/"+b.postId+"/move-discussion-to-chat", data:{fkey:StackExchange.options.user.fkey},type:"POST"},"when trying to move the discussion to chat",c).done(function(a){a.success?window.location.href=a.message:StackExchange.helpers.showErrorPopup(c,a.message)})}).end().prependTo(c),a.remove())}}});

So, we can see that it is doing a POST to /posts/{postId}/move-discussion-to-chat and StackExchange.options.user.fkey is passed along; this would require an user script to replicate. Simply because you can only make GET requests through your address bar...

Here are observations when reproducing this:

  1. It does not work on Meta.SU, simply because there is no chat for Meta.SU.

  2. This does not work on posts you are not involved in, luckily...

  3. Refiring this on my posts does not seem to work, the conditions are effectively checked.

    HTTP/1.1 404 Not Found
    Cache-Control: private
    Content-Type: application/json
    Set-Cookie: usr=t=$$$$&s=$$$$; domain=.superuser.com; expires=$$$$; path=/; HttpOnly
    Date: $$$$
    Content-Length: 0
    

    Note that I filtered away personal information with $$$$.

    Alternatively, it could use cookies to check whether the requests have not been tampered with. Seems the Stack Exchange developers do their job well, for a good reason...

8
  • 3
    If you and I get into a long thread here on this Answer like it's our own little sandbox, will Meta give us the "take it to chat" link? We could give it a try, but I don't know if Meta's running the same code as the main site.
    – Spiff
    Commented Mar 28, 2012 at 1:25
  • I have yet to see a Meta comment thread (especially on Meta.SO) be moved to a chatroom. I don't know if this is by design, or if users ignore the offer.
    – iglvzx
    Commented Mar 28, 2012 at 1:29
  • Comment. For science!
    – iglvzx
    Commented Mar 28, 2012 at 6:58
  • @Spiff I'll try it (triggering a chat in Meta) with you.
    – Jeremy W
    Commented Apr 3, 2012 at 18:20
  • @JeremyW Let's do this.
    – Spiff
    Commented Apr 3, 2012 at 18:38
  • @Spiff bit of a time delay on my part - the Supermega Collider Inbox Widget didn't notify me.
    – Jeremy W
    Commented Apr 4, 2012 at 2:10
  • wow, this helps me so much sarcasm and how exactly do you expect me to implement this code since I am not the webmaster?
    – superuser
    Commented Jul 2, 2012 at 8:08
  • @techaddict: This is ECMAScript, which is a client-side language and can easily be implemented given that it has to run on the client, which means YOU can run it. If you want to know how, feel free to ask a question on Super User because such information does not belong on Meta. Oh, and where exactly did I actually tell you to implement something? You must be trolling... Commented Jul 2, 2012 at 12:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .