Skip to content

Setting line attribute on other author's line #2921

@g-borgulya

Description

@g-borgulya

If a user opens a pad containing text from another author (eg. pad created by copypad),
and a line that has already line attributes get's a new line attribute with the command AttributeManager.setAttributeOnLine then etherpad disconnects, saying:

 Error: Can't apply USER_CHANGES, because Trying to submit changes as another author in changeset

Which seems to be true as the changeset's author differs from the current user's ID.

I have a guess how to fix this problem but as I'm not too deep in the etherpad source so I rather just put it here:

setAttributeOnLine: function(lineNum, attributeName, attributeValue){
...
if(hasMarker){
  ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), [
    [attributeName, attributeValue]
  ], this.rep.apool);
}
...

at this point I guess the ['author', this.author] should also be inserted in the changeset data.

I'm not sure about this, please consider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions