spreed icon indicating copy to clipboard operation
spreed copied to clipboard

Newlines removed when paste text to chat box.

Open Elfanar opened this issue 7 years ago • 12 comments

Steps to reproduce

1- Install NextCloud 15 2- Install NextCloud Talk 5.0.2. 3- Start text chat. 4- Try to paste any text that includes at least 1 newline, and send it. 5- All new lines will be lost when text sent.

Expected behaviour

Text to be sent exactly as it is, with the newlines intact.

Actual behaviour

newlines removed, leaving text glued to each other.

Browser

. Microphone available: yes/no no Camera available: yes/no no Operating system: Windows/Ubuntu/... All Browser name: Firefox/Chrome/... Chrome Browser version: 50.1/55/... Several

Browser log

``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```

Spreed app

Spreed app version: (see apps admin page: /index.php/settings/apps) 5.0.2

Custom TURN server configured: yes/no (see additional admin settings: /index.php/settings/admin/additional)

Custom STUN server configured: yes/no (see additional admin settings: /index.php/settings/admin/additional) no

Server configuration

Operating system: Ubuntu/RedHat/... Ubuntu Web server: Apache/Nginx Apache Database: MySQL/Maria/SQLite/PostgreSQL MySQL PHP version: 7.2 Nextcloud Version: (see admin page) 15 List of activated apps: Almost all of them

``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your server installation folder ```

Nextcloud configuration:

``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder ```

Server log (data/nextcloud.log)

``` Insert your server log here ```

Elfanar avatar Feb 20 '19 07:02 Elfanar

I just copied your steps:

1- Install NextCloud 15
2- Install NextCloud Talk 5.0.2.
3- Start text chat.
4- Try to paste any text that includes at least 1 newline, and send it.
5- All new lines will be lost when text sent.

And it correctly posted that as 5 lines.

nickvergessen avatar Feb 20 '19 07:02 nickvergessen

Maybe you are using different version. screenshot from 2019-02-20 10-53-02 Care to join my NC installation for testing ?

Elfanar avatar Feb 20 '19 07:02 Elfanar

Care to join my NC installation for testing ?

Elfanar avatar Feb 20 '19 07:02 Elfanar

feel free to send an account to <my github name>@nextcloud.com

nickvergessen avatar Feb 20 '19 07:02 nickvergessen

Sent

Elfanar avatar Feb 20 '19 09:02 Elfanar

Also works fine on your instance, maybe the problem is where you copy it from?

nickvergessen avatar Feb 20 '19 10:02 nickvergessen

No I don't think so, I am using Ubuntu desktop, my associate is using Windows 10, but we both use Chrome browser.

Elfanar avatar Feb 20 '19 20:02 Elfanar

And the content you copy from is a website? Or word document, or...?

nickvergessen avatar Feb 20 '19 21:02 nickvergessen

Several, with same result, I can give you remote access to test yourself (teamviewer or something).

Elfanar avatar Feb 20 '19 22:02 Elfanar

Okay, managed to reproduce now, it only happens in Chrome.

When you copy: 1- Install NextCloud 15 2- Install NextCloud Talk 5.0.2. 3- Start text chat. 4- Try to paste any text that includes at least 1 newline, and send it. 5- All new lines will be lost when text sent.

Firefox inserts this as:

1- Install NextCloud 15<br>
2- Install NextCloud Talk 5.0.2.<br>
3- Start text chat.<br>
4- Try to paste any text that includes at least 1 newline, and send it.<br>
5- All new lines will be lost when text sent.

But Chrome/Chromium inserts:

1- Install NextCloud 15
<div>2- Install NextCloud Talk 5.0.2.</div>
<div>3- Start text chat.</div>
<div>4- Try to paste any text that includes at least 1 newline, and send it.</div>
<div>5- All new lines will be lost when text sent.</div>

That however does not trigger https://github.com/nextcloud/spreed/blob/58f0bd6d2f5d6ec6a12fbd9ef82991fa0a99334a/js/views/chatview.js#L701-L702 to instead line breaks into the text which are then later taken into account when getting .text()

nickvergessen avatar Feb 21 '19 08:02 nickvergessen

@Elfanar fix is in https://github.com/nextcloud/spreed/pull/1570

nickvergessen avatar Feb 21 '19 09:02 nickvergessen

Tested the fix and it is working, thank you very much ! Can I contact you in Private again please ?

Elfanar avatar Feb 21 '19 11:02 Elfanar