[CDB] mChat

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Anti-Spam Guide
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Locked
edrimon
Registered User
Posts: 49
Joined: Tue Jul 15, 2014 12:20 pm

Re: [RC] mChat

Post by edrimon » Tue Jul 26, 2016 12:19 pm

Hi

thanks for the excellent chat.

I can see that by default mChat in the index page is not showing when not logged in. I would like to have it shown with the input box faded. How can I achieve this? Actually I want to find where exactly in the code is shown/not shown based on logged in status..

Thanks

voom
Registered User
Posts: 59
Joined: Tue Mar 22, 2016 1:31 am

Re: [RC] mChat

Post by voom » Wed Jul 27, 2016 1:39 am

Maybe you can help me out - I tried to deactivate (or speed up) the animation when a new message is added. When the frequency of messages is more like a chat than a shoutbox it is more disturbing than appealing. Especially if one enters the custom page and say 50 messages are new, they all appear one after the other slowly. The animations for edited or deleted messages are nice and fine.

So how can I deactivate the animation shown when new messages are added? :)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Wed Jul 27, 2016 9:11 am

edrimon wrote:I would like to have it shown with the input box faded.
Go to the group permissions for the Guests group and set Can view mChat (u_mchat_view) to yes and Can use mChat (u_mchat_use) to no. This is where the permission is checked.
voom wrote:Especially if one enters the custom page and say 50 messages are new, they all appear one after the other slowly.
How many active chat users do you have that they post 50 messages within one refresh interval? :o Anyway, change the 400 here to 0 to remove the delay and change this line to $message.show(); to remove the animation.

By the way, the next mChat release will allow you to create an mChat addon extension to modify this behavior. This will save you from editing any mChat code and reapplying the edits in future updates.

voom
Registered User
Posts: 59
Joined: Tue Mar 22, 2016 1:31 am

Re: [RC] mChat

Post by voom » Wed Jul 27, 2016 10:41 am

kasimi wrote:How many active chat users do you have that they post 50 messages within one refresh interval?
This happens, if the user was not in the chat for a while, initially opening the chat the max number of messages will be loaded that way, if they are new at that point.
Anyway, change the 400 here to 0 to remove the delay and change this line to $message.show(); to remove the animation.
Thanks; I tried that but changing line 229 leads to new messages appearing only after manual reload of the page, while changing line 231 changes nothing.
By the way, the next mChat release will allow you to create an mChat addon extension to modify this behavior. This will save you from editing any mChat code and reapplying the edits in future updates.
I fear I have already changed so much, that I might have to manually add any changes. But in the long run this sounds great! :)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Wed Jul 27, 2016 3:43 pm

voom wrote:This happens, if the user was not in the chat for a while
Please correct me if I'm wrong: a user's chat session hits the timeout, mChat stops updating. Others continue chatting but that user doesn't see those messages obviously. After a while the user starts chatting again, at which point all messages from the other users are added, in your case 50.

If I understood you correctly, disabling the animation only for messages added for the first time after a session timeout would be a possible solution I think everyone would benefit from. :)

voom
Registered User
Posts: 59
Joined: Tue Mar 22, 2016 1:31 am

Re: [RC] mChat

Post by voom » Wed Jul 27, 2016 3:48 pm

Yes, you got what I meant. As a general setting what you propose makes sense to me.

Anyway - any idea why those changes l229 and l231 did not work (for me)? I still would like to be able to disable the animation for newly added messages completely. :)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Wed Jul 27, 2016 4:56 pm

voom wrote:Anyway - any idea why those changes l229 and l231 did not work (for me)?
Ignore the line numbers that you see on GitHub - go by the code that's highlighted. If you need more help, post what you've changed exactly.

voom
Registered User
Posts: 59
Joined: Tue Mar 22, 2016 1:31 am

Re: [RC] mChat

Post by voom » Wed Jul 27, 2016 5:03 pm

kasimi wrote:
voom wrote:Anyway - any idea why those changes l229 and l231 did not work (for me)?
Ignore the line numbers that you see on GitHub - go by the code that's highlighted. If you need more help, post what you've changed exactly.
Sure, that is exactly what I did, I used the line-numbers only for reference here. In my case the respective code is on different lines. I understand basically what the changes are supposed to do and have been experimenting with the "400" before with no effect.

The other change was to exchange the whole line:

Code: Select all

$message.css('opacity', 0).slideDown().animate({opacity: 1}, {queue: false});
to

Code: Select all

$message.show();
Doing that had the effect that new messages did not appear until I did a complete reload of the page. (At least my own, I tested in a dev environment with no other chatters present at that point)

I wonder: the first line changes the opacity from 0 to 1 because "display:block" would not be animatable. The second line - would that change the display-value? Maybe just change the visibility to 1 without animation? I would not know how to change the line to do that.

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Wed Jul 27, 2016 5:42 pm

voom wrote:because "display:block" would not be animatable
I'm not sure what you mean here but this works just fine with jQuery:

Code: Select all

$elem.hide().slideDown(); 
This is what mChat does essentially, with an opacity animation on top. There's no CSS visibility involved. I suspect either your edits in mchat.js or your Bootstrap-bases style to cause these issues because my proposed edits work fine in my test environment.
voom wrote:change the visibility to 1 without animation

Code: Select all

$elem.css('visibility', 1); 

voom
Registered User
Posts: 59
Joined: Tue Mar 22, 2016 1:31 am

Re: [RC] mChat

Post by voom » Wed Jul 27, 2016 5:50 pm

or your Bootstrap-bases style to cause these issues
That is very likely; changes to the mchat.js are rather not the issue because so far I have not made any ;)

Code: Select all

$elem.hide().slideDown();
That gave me this idea:

Code: Select all

$message.show().slideDown();
And that works! Thanks... :)

User avatar
mrgtb
Registered User
Posts: 563
Joined: Wed Oct 03, 2007 10:51 am

Re: [RC] mChat

Post by mrgtb » Wed Aug 03, 2016 5:38 pm

I'm trying to make shoutbox messages so when a usergroup is not allowed to post chats, instead of them still seeing what is typed in shoutbox by others, they instead see a "no permission text messages" (as all shouts displayed) pulled from a common language entry added.

In the mchat_messages template I replaced this line below:

Code: Select all

<div class="mchat-text">{mchatrow.MCHAT_MESSAGE}</div>
With this using a permission wrapped around message:

Code: Select all

<div class="mchat-text"><!-- IF MCHAT_ALLOW_USE -->{mchatrow.MCHAT_MESSAGE}<!-- ELSE -->{L_CUSTOM_MESSAGE}<!-- ENDIF --></div>
It seems to work showing no permission text to guest for all shouts, if not allowed to use shoutbox. But when I post as Admin "allowed to use shoutbox", the message I post shows up first as that No Permission text - until I refresh page and then it will show my real message just typed (as though some cache thing is going on)?

Any ideas on this?

I also tried using this one as well. To limit it to "just guests only" not having permission to read real message in shoutbox (but only if guest shouts is disabled though), otherwise they see real messages if shouts is "enabled" for guests. Same thing happens though when posting as admin and not seeing real message I posted first until refreshing page.

Code: Select all

<!-- IF not S_REGISTERED_USER and not MCHAT_ALLOW_USE -->{L_CUSTOM_MESSAGE}<!-- ELSE -->{mchatrow.MCHAT_MESSAGE}<!-- ENDIF -->

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Wed Aug 03, 2016 7:11 pm

Open /core/mchat.php

Find:

Code: Select all

'MCHAT_ALLOW_QUOTE'				=> $this->auth->acl_get('u_mchat_quote'),
Insert after:

Code: Select all

'MCHAT_ALLOW_USE'				=> $this->auth->acl_get('u_mchat_use'),

User avatar
mrgtb
Registered User
Posts: 563
Joined: Wed Oct 03, 2007 10:51 am

Re: [RC] mChat

Post by mrgtb » Wed Aug 03, 2016 7:32 pm

kasimi wrote:Open /core/mchat.php

Find:

Code: Select all

'MCHAT_ALLOW_QUOTE'				=> $this->auth->acl_get('u_mchat_quote'),
Insert after:

Code: Select all

'MCHAT_ALLOW_USE'				=> $this->auth->acl_get('u_mchat_use'),
Nice one, thanks very much! It seems to work perfect, even on testing groups allowed to use chat or not. :D

User avatar
Dragonwolf
Registered User
Posts: 603
Joined: Mon Aug 20, 2007 7:46 pm

Re: [RC] mChat

Post by Dragonwolf » Thu Aug 04, 2016 11:13 am

For some reason I get this error when I try to set the options for mchat in the extensions tab of the ACP. Can anyone help? I did peviously install the Phpbb 3.0 mod version of this extension, could it be caused by that since the files aren't present anymore? If so, is there a way to set options for Mchat as the replies are appearing at the top of the feed and I want them to appear at the bottom?
Module file ./../includes/acp/acp_mchat.php does not contain correct class [acp_mchat]

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/functions_module.php
LINE: 578
CALL: trigger_error()

FILE: [ROOT]/adm/index.php
LINE: 81
CALL: p_master->load_active()

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3793
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [RC] mChat

Post by kasimi » Thu Aug 04, 2016 11:21 am

Try clearing the cache. If that doesn't help you need to uninstall mChat and remove any modules leftovers of the MOD in the ACP module management.
Dragonwolf wrote:I want them to appear at the bottom?
This is a setting in the UCP so that users can customize it to their liking.

Locked

Return to “Extensions in Development”