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

Able to send a blank message #1143

Closed
prajwalpoojari9876 opened this issue Jul 30, 2018 · 4 comments

Comments

@prajwalpoojari9876
Copy link

commented Jul 30, 2018

@jcbrand
image

@jcbrand

This comment has been minimized.

Copy link
Member

commented Jul 30, 2018

What version are you using? How do you do this? Doesn't look to be possible in the master branch.

@jcbrand jcbrand added the question label Jul 30, 2018

@prajwalpoojari9876

This comment has been minimized.

Copy link
Author

commented Jul 30, 2018

Version: 3.3.4

Enter only " " (space) and then send.

@jcbrand jcbrand added bug and removed question labels Jul 30, 2018

@jcbrand jcbrand added this to the 4.0.0 milestone Jul 30, 2018

@prajwalpoojari9876

This comment has been minimized.

Copy link
Author

commented Jul 31, 2018

@jcbrand Thnx for your support.

As of now, we made a solution for this, We override the "onMessageSubmitted" method of "ChatRoomView" (as we are using conversejs muc embedded). Below is the code:

converse.plugins.add('myplugin', {
    initialize: function () {
        var _converse = this._converse;
    },
    overrides: {
        ChatRoomView: { //FOR MUC
            onMessageSubmitted : function(text){
                if (!text.replace(/\s/g, '').length) {
                    return false;
                }
                return this.__super__.onMessageSubmitted.apply(this, arguments);
            }
        }
    }
});

@jcbrand jcbrand changed the title Able to send blank message in conversejs. Restrict user to send message with only whitespace Able to send a blank message Aug 1, 2018

@jcbrand jcbrand closed this in b027f0f Aug 1, 2018

@jcbrand

This comment has been minimized.

Copy link
Member

commented Aug 1, 2018

Thanks @prajwalpoojari-TOPS, it's fixed now in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.