Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timestamp, Moderation Functions, Minimize Button #34

Open
warpunish opened this issue Dec 6, 2017 · 12 comments
Open

Timestamp, Moderation Functions, Minimize Button #34

warpunish opened this issue Dec 6, 2017 · 12 comments

Comments

@warpunish
Copy link

Hello,

We have been using your chat extension on our website for 4 months. Right now it works as good as it should be but it needs some improvements. We are getting nice traffic on our website and chat needs a delete message function because as you know, there are trolls everywhere. What it should do is delete a message if needed and update everyones chat frame as message deleted. Our users want timestamp for their messages. Right now when someone sends a message its unknown when it was sent. Another issue is chat minimization works perfect but it doesn't give a hint that when user clicks header bar it minimizes the frame. So what would be better is adding a minimize button to minimize chat frame. I know these are too much to ask and you might be busy. I am a ready to fork it to add these but i don't know which function does what. So if you are not willing to add these options, i am asking for a lead for what should i do to add these improvements.

@jtojnar
Copy link
Contributor

jtojnar commented Dec 6, 2017

  • Weird, I thought I had opened a pull requests with timestamps in the title but it apparently is not the case. See e2b6a90 on general idea how to implement it.

  • The header bar is described here

    m('div', {id: 'chat-header', onclick: this.toggle.bind(this, ctrl)}, [
    m('h2', app.translator.trans('pushedx-chat.forum.toolbar.title')),
    m('p', {
    'data-title': ctrl.isMuted ? app.translator.trans('pushedx-chat.forum.toolbar.enable_sounds') : app.translator.trans('pushedx-chat.forum.toolbar.disable_sounds'),
    },[
    m('img', {
    src: ctrl.isMuted ? soundMuted : soundNormal,
    onclick: this.toggleSound.bind(this, ctrl)
    }),
    ]),
    m('p', {
    'data-title': ctrl.notify ? app.translator.trans('pushedx-chat.forum.toolbar.disable_notifications') : app.translator.trans('pushedx-chat.forum.toolbar.enable_notifications'),
    },[
    m('img', {
    src: ctrl.notify ? notifyNormal : notifyDisabled,
    onclick: this.toggleNotifications.bind(this, ctrl),
    }),
    ]),
    ]),

  • The moderation will be the most complex, you will need to:

    • add a pushedx.chat.delete permission to js/admin/src/main.js
    • create a DeleteChatController, you can base it on src/Api/Controllers/FetchChatController.php
    • maybe create a DeleteChatSerializer?
    • create a DeleteChat command, see src/Commands/PostChat.php and a handler
    • add an API route and canDeleteChat attribute in src/Listeners/AddChatApi.php
    • add an interface; in the simplest case, you will want to add a delete button somewhere in the message wrapper
    • add translations

IDK, maybe I missed something, basically you need to go through every file and either edit it or clone it with a Delete in name.

@gpascualg
Copy link
Member

gpascualg commented Jan 18, 2018

@jtojnar Could you PR the timestamps? Or have you done any work towards moderation? I'm way to busy right now to do it :(

I can't seem to find commit e2b6a90?

@jtojnar
Copy link
Contributor

jtojnar commented Jan 18, 2018

I am quite busy as well. If you want to use it, the commit is in this branch. Not sure why I did not open a PR; we have been using it on https://ostrov-tucnaku.cz/ for a while now so there should not be any serious issue.

@gpascualg
Copy link
Member

No problem! You've done a lot of work already, I'll manually cherry-pick it later, thx!

@jtojnar jtojnar mentioned this issue Apr 18, 2018
@hifihedgehog
Copy link

I am on shared hosting without SSH so I use Bazaar exclusively. Is there a way I might be able to grab the moderation bits via Bazaar? Or should I simply be able to upload jtojnar's files over top gpascualg's without any trouble? Thank you everyone for your help over the last few days.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 19, 2018

There are no moderation bits implemented. The only unmerged change are the timestamp tooltips and Telegram notifications hack. Just copying the files over will not work since the same files have been modified. You will need to use git to merge the conflicts before copying the resulting sources to your server.

@hifihedgehog
Copy link

hifihedgehog commented Apr 19, 2018

Just copying the files over will not work since the same files have been modified.

But I can also just download your fork from this link, correct?
https://github.com/jtojnar/flarum-ext-chat
I am not saying I would download from gpascualg's repo, where your changes haven't been implemented.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 19, 2018

As GitHub says, “This branch is 6 commits behind Push-EDX:master”, the ot branch is probably up to date, but you might want to use ot^ if you do not use Telegram.

@gpascualg
Copy link
Member

@jtojnar Maybe you could do some PRs for that? Having some settings to toggle on/off telegram notifications and so on

@jtojnar
Copy link
Contributor

jtojnar commented Oct 7, 2018

I thought you were going to cherry-pick the timestamp commit. As for the telegram code, it is jut a hack; I was waiting for some kind of hook to Flarum Notify extension.

@gpascualg
Copy link
Member

Yeah.. completely forgot about it, I've been disconnected from flarum lately. I've just cherry-picked it.

Ok, sounds like a good idea to wait for Notify extension

@jtojnar
Copy link
Contributor

jtojnar commented Oct 7, 2018

Actually we already have an issue about the notification events: #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants