[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!
Get Involved
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
Jon_Hart
Registered User
Posts: 18
Joined: Tue Dec 29, 2015 10:03 am

Re: [RC] mChat

Post by Jon_Hart » Sat Sep 24, 2016 7:00 pm

kasimi wrote:This sure sounds like a bug. To be clear, this happens even if you don't touch the scrollbars? How often does that happen? Is there any special content (BBCode, image, content from another extension) in those messages that stop the auto-scrolling?
Yes, even if it is just sitting on the newest post it will stop auto-scrolling after a while. Happens regardless of the message content. The page is fully loaded and just sitting there, as new messages come in it eventually stops scrolling with them.

Although a different thing I noticed was when large content like videos or iframes are embedded it scrolls up when they load in on a page refresh. The messages load in with the scroll bar at the bottom, but when the above messages expand when their content loads it pulls the scrollbar halfway up to them. Which is a bit annoying is all.

Edit: I see you've got some test code up, I'll try to check that out and let you know what happens.

Edit2: I copied the test code over and it seems to have fixed the autoscrolling when the user is looking at the newest messages and they don't contain embedded content. It wasn't working at all for certain users before, and is now. Embedded content still seems to break the auto-scrolling though. It scrolls to the initial bottom of the message, but once the message expands it doesn't keep going.

Edit3: Works with youtube videos and twitch streams with the s9e/mediaembed embedding, but not with say a long tumblr post.

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 » Sat Sep 24, 2016 8:50 pm

Thanks for testing! It turns out to be quite tricky to handle auto-scrolling with variable content. The fix you applied works like this: scroll to the bottom, and once there, check if the container's height has increased, and if so, keep scrolling, and then check again, and so on. If the content takes longer to load than the auto-scrolling needs to reach the bottom, it won't scroll again after the content has eventually loaded. The initial scrolling after a page load suffers from the same problem.

You mention long Tumblr posts: does auto-scrolling to the bottom even make sense if the content is that long? Wouldn't you want to start reading from the top of the message?

At the moment I'm not sure how to further improve the code.

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 8:55 pm

Hi, this is my first post here and in need of some assistance with this extension.

Installed mChat 2.0.0-RC6 without issue.

The issues that arose were as follows:

- mChat put itself at the top of the index page, and regardless of what setting, it would not move either off the index page or to the bottom
- changing the name of the nav bar link to simply cite "chat."

I have currently disabled it, as I do not want this sitting at the top of the forums, just a nav bar link for those interested in chatting.

phpbb is 3.1.9

Thanks in advance for your help (and yes I did search and found nothing which led me to register and post this plea for assistance.)

Jon_Hart
Registered User
Posts: 18
Joined: Tue Dec 29, 2015 10:03 am

Re: [RC] mChat

Post by Jon_Hart » Sat Sep 24, 2016 9:05 pm

kasimi wrote:Thanks for testing! It turns out to be quite tricky to handle auto-scrolling with variable content. The fix you applied works like this: scroll to the bottom, and once there, check if the container's height has increased, and if so, keep scrolling, and then check again, and so on. If the content takes longer to load than the auto-scrolling needs to reach the bottom, it won't scroll again after the content has eventually loaded. The initial scrolling after a page load suffers from the same problem.

You mention long Tumblr posts: does auto-scrolling to the bottom even make sense if the content is that long? Wouldn't you want to start reading from the top of the message?

At the moment I'm not sure how to further improve the code.

True, it's not really an issue. Those types of posts should be rare enough that it won't really matter. Thanks for looking into the issue for regular and video posts though.

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 » Sat Sep 24, 2016 9:06 pm

tonyJones wrote:mChat put itself at the top of the index page
Use the UCP settings to allow users to change it individually, or force it for all users by setting the permission Can customise Location of mChat on the index page in the mChat in UCP tab for all users to No so that the setting as specified in the ACP in the Global user settings can take effect.
tonyJones wrote:changing the name of the nav bar link to simply cite "chat."
Open ext/dmzx/mchat/language/en/common.php and change MCHAT_TITLE and MCHAT_TITLE_COUNT.

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 9:20 pm

Thanks for the quick reply, while I was able to change the nav bar title, I was only able to move the chat to the bottom.

Seeking to remove it from the index page entirely.

Maybe I am going into the wrong section to accomplish this?

USERS AND GROUPS > GROUP PERMISSIONS > ADVANCED PERMISSIONS > mChat in UCP
kasimi wrote:
tonyJones wrote:mChat put itself at the top of the index page
Use the UCP settings to allow users to change it individually, or force it for all users by setting the permission Can customise Location of mChat on the index page in the mChat in UCP tab for all users to No so that the setting as specified in the ACP in the Global user settings can take effect.
tonyJones wrote:changing the name of the nav bar link to simply cite "chat."
Open ext/dmzx/mchat/language/en/common.php and change MCHAT_TITLE and MCHAT_TITLE_COUNT.

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 » Sat Sep 24, 2016 9:24 pm

Yes, that's where you remove the permission for users to customize the respective settings. If a user doesn't have a certain permission, the value in the ACP -> Extensions -> mChat Global User Settings is used.

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 9:27 pm

All permissions have been set to "no" and I have purged the cache and it still is on the index page.

kasimi wrote:Yes, that's where you remove the permission for users to customize the respective settings. If a user doesn't have a certain permission, the value in the ACP -> Extensions -> mChat Global User Settings is used.

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 » Sat Sep 24, 2016 9:30 pm

Have you check all permissions? Read here: viewtopic.php?p=14526651#p14526651

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 10:28 pm

Odd, but getting through it.

Another question, do you know where I can enable autoscroll to the newest message?
kasimi wrote:Yes, that's where you remove the permission for users to customize the respective settings. If a user doesn't have a certain permission, the value in the ACP -> Extensions -> mChat Global User Settings is used.

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 » Sat Sep 24, 2016 10:42 pm

Auto-scroll is always enabled, there is no option to disable it. There is one exception: if you're not scrolled to the bottom (or to the top if messages appear at the top), auto-scroll doesn't happen because the user is most likely reading previous messages and thus doesn't want to get scrolled away. So, when you're done reading, scroll all the way to the bottom and auto-scroll is active again. :)

Maybe there's a nice way to visualize this. I'm open for suggestions.

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 10:51 pm

Hmm, ok.

Doesn't seem to be working that way, but will see in the next test.

Also, would you know how to give admin the power to delete any post in the mchat?

Thanks for the replies.
kasimi wrote:Auto-scroll is always enabled, there is no option to disable it. There is one exception: if you're not scrolled to the bottom (or to the top if messages appear at the top), auto-scroll doesn't happen because the user is most likely reading previous messages and thus doesn't want to get scrolled away. So, when you're done reading, scroll all the way to the bottom and auto-scroll is active again. :)

Maybe there's a nice way to visualize this. I'm open for suggestions.

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 » Sat Sep 24, 2016 11:01 pm

tonyJones wrote:Doesn't seem to be working that way, but will see in the next test.
Yes it's not working perfectly in RC6, here's a fix if you want to get your hands dirty: https://github.com/kasimi/mChat/commit/ ... 9ce616ae66
tonyJones wrote:how to give admin the power to delete any post in the mchat
Check mChat's permissions tab, there's one called Can delete anyone’s messages. Set it to true for the admin user or for the admin group's role.

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

Re: [RC] mChat

Post by mrgtb » Sat Sep 24, 2016 11:06 pm

tonyJones wrote:Also, would you know how to give admin the power to delete any post in the mchat?
You need to look at permissions for User Roles, and Group permissions. Some permissions like for guest and bots I think are set at Group permissions because they don't have a User Role (as such), but for Admin, mods and members they get set at User Roles permissions. So you need also look at shoutbox permissions listed "User Roles" for things like Full Access (staff and mods), No Avatar, Newly Registered Users, etc. Which once you set them all up will kind of pre set the permissions for most User groups listed under Group permissions except for Bots and Guests - that I set at Group Permission then because there's no role for them to set.

For example: You might not be able to delete posts for all users as admin because under User Roles (full Access) used for admin and mods - it might not be set to allow delete all shouts under shoutbox tab - which is overriding you trying to set permission for admin at group permission instead.

tonyJones
Registered User
Posts: 12
Joined: Sat Sep 24, 2016 8:47 pm

Re: [RC] mChat

Post by tonyJones » Sat Sep 24, 2016 11:30 pm

OK got the admin to have the ability to delete posts.

Replaced the mchat.js with that one, but no change at all.

I purged the cache, but it had no effect.
kasimi wrote:
tonyJones wrote:Doesn't seem to be working that way, but will see in the next test.
Yes it's not working perfectly in RC6, here's a fix if you want to get your hands dirty: https://github.com/kasimi/mChat/commit/ ... 9ce616ae66
tonyJones wrote:how to give admin the power to delete any post in the mchat
Check mChat's permissions tab, there's one called Can delete anyone’s messages. Set it to true for the admin user or for the admin group's role.

Locked

Return to “Extensions in Development”