Siropu Chat2 Investigations

Macrobius

Megaphoron

Problem: how to control embed code on a per room basis.

Investigation status: UNDER INVESTIGATION

  1. Display Mode (All Pages, Forums List Above, Forums List Below, Sidebar Below Visitor Panel, Sidebar Bottom, Chat Page Only, Embed

Maybe something else: [[ pretty sure embed mode is how we are running and doesn't relate to oEmbed features ]]

All Pages Mode it displays a bar at the bottom of the window with the last posted message and the number of chatters. When you click on the bar, the chat get displayed and you can chat from any page at any time. This way you don't have to stay on specific page to chat.

Embed Mode allows you to embed the chat with any room anywhere you want in the template using a template callback with XF's Template Modifications System.

There is also a mode called Full Page Mode which allows you to embed the chat using an iframe. To use it, you just need to add /fullpage to the end of the chat page URL.

I do see that it is possible in the Siropu Chat2 options to completely disable MEDIA BBCODES ... not sure if that disables them in the editor.

Screenshot 2022-01-17 6.28.59 PM.png
 
Last edited:

Macrobius

Megaphoron
This is the code for the EMBED template for Tweeter... (as an example)

Code:
<xf:page option="jsState.twitter" value="{{ true }}" />
<xf:js src="xf/embed.js" min="1" />

<div class="bbMediaJustifier bbCode-tweet"
      data-xf-init="tweet"
      data-tweet-id="{$id}"
      data-lang="{$xf.language.language_code}"
      data-theme="{{ property('styleType') }}"
      ><a href="https://twitter.com/i/web/status/{$id}" rel="external" target="_blank">
    <i class="fab fa-twitter" aria-hidden="true"></i> https://twitter.com/i/web/status/{$id}</a></div>

So, the crux of the 'problem' is that when tweeter... blah blah ID is matched, it gets rewritten with the ID part and the name is thrown away.

Looking at the Facebook embed example, which is moar complex, we should be able to customize.
 
Last edited:

Macrobius

Megaphoron
OK - after looking at this moar, I think I can give the admins here a hotfix that will

1/ preserve the URL the user actually pasted, both visually and in an archival sense[1]
2/ longer term, I'll experiment with ways to suppress media link expansion the chat, if there is no global way to just turn it off [2]

I'll add more to this thread on how embeds work in XF2 and how to hotfix/patch the undesirable behaviour. Probably next weekend -- after all the Marchin' an Lootin' yesterday I now have to work foah tens.

[1]: this matters when Tweeter nukes an account. You can't even learn the name of the banned user from the i/status link -- it just all goes right down the memory hole.

[2]: it looks like expanding media embeds is done at the XF2 level, not in the plugin, but maybe we can have a custom BBCODE tag or some hook that rewrites it so we can get the desired behaviour. This will take a bit of research.

None of this should require custom PHP -- just a couple of cut/paste operations in the admin interface, which I will document below
 

Grug Arius

Phorus Primus
Staff member
template media_site_embed_twitter

Code:
<xf:page option="jsState.twitter" value="{{ true }}" />
<xf:js src="xf/embed.js" min="1" />

<div class="bbMediaJustifier bbCode-tweet"
      data-xf-init="tweet"
      data-tweet-id="{$id}"
      data-lang="{$xf.language.language_code}"
      data-theme="{{ property('styleType') }}"
      ><a href="https://twitter.com/i/web/status/{$id}" rel="external" target="_blank">
    <i class="fab fa-twitter" aria-hidden="true"></i> https://twitter.com/i/web/status/{$id}</a></div>
 

Grug Arius

Phorus Primus
Staff member
note:links poasted in chat persist in the state according to the chat options configuration even if the options are later changed

this is an adequate solution for now

cant have media blowing up the chat
 
Top