miguelfreitas / twister-html

twister HTML + Javascript User Interface
MIT License
229 stars 138 forks source link

Group invite peers requires @ (but no hint is provided) #326

Closed miguelfreitas closed 8 years ago

miguelfreitas commented 8 years ago

Inviting peers to join a chat group requires each username to be preceded by @, however no hint is provided to user about this requirement. Trying to invite without @ causes a strange error:

Can't invite null to *fgdfgdgdfgdgdfg group...

User is left stuck with the problem.

Of course, this is a issue with twister_directmsg.js around line 489:

        var peersToInvite = elemInput.val().toLowerCase().match(/@\w+/g);
        if (peersToInvite)
            peersToInvite = peersToInvite.join('').slice(1).split('@');

It seems a bit too strict about requiring @. Maybe an alternative syntax with space or comas as separators should be accepted as well.

slr commented 8 years ago

example is added to placeholder of invitation form: https://github.com/miguelfreitas/twister-html/commit/3ae58616cfb940bc82d9c00eb0564122509273a9

miguelfreitas commented 8 years ago

good idea.