Skip to content

Commit

Permalink
Fix an mistake in dataforms field. Values are set of strings (to hand…
Browse files Browse the repository at this point in the history
…le multiple values, eg: list-multi)
  • Loading branch information
nathan130200 committed May 11, 2024
1 parent 50a7bb4 commit a41bb2e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions XmppSharp/Protocol/DataForms/Field.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,20 @@ public bool IsRequired
}
}

public new string Value
public IEnumerable<string> Values
{
get => this.GetTag("value");
set => this.SetTag("value", value: value);
get
{
foreach (var element in this.Children("value", Namespace.DataForms))
yield return element.Value;
}
set
{
Children("value", Namespace.DataForms).Remove();

foreach (var str in value)
this.SetTag("value", Namespace.DataForms, str);
}
}

public IEnumerable<Option> Option
Expand Down

0 comments on commit a41bb2e

Please sign in to comment.