Skip to content

Commit

Permalink
revert mobile bindings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alun Turner committed Jun 16, 2023
1 parent 42300cd commit 2ed5d77
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions bindings/wysiwyg-ffi/src/ffi_composer_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,19 @@ impl ComposerModel {
self: &Arc<Self>,
url: String,
text: String,
_attributes: Vec<Attribute>, // TODO remove attributes
attributes: Vec<Attribute>, // TODO remove attributes
) -> Arc<ComposerUpdate> {
let url = Utf16String::from_str(&url);
let text = Utf16String::from_str(&text);
let attrs = vec![];
let attrs = attributes
.iter()
.map(|attr| {
(
Utf16String::from_str(&attr.key),
Utf16String::from_str(&attr.value),
)
})
.collect();
Arc::new(ComposerUpdate::from(
self.inner.lock().unwrap().insert_mention(url, text, attrs),
))
Expand Down Expand Up @@ -304,12 +312,20 @@ impl ComposerModel {
url: String,
text: String,
suggestion: SuggestionPattern,
_attributes: Vec<Attribute>, // TODO remove attributes
attributes: Vec<Attribute>, // TODO remove attributes
) -> Arc<ComposerUpdate> {
let url = Utf16String::from_str(&url);
let text = Utf16String::from_str(&text);
let suggestion = wysiwyg::SuggestionPattern::from(suggestion);
let attrs = vec![];
let attrs = attributes
.iter()
.map(|attr| {
(
Utf16String::from_str(&attr.key),
Utf16String::from_str(&attr.value),
)
})
.collect();
Arc::new(ComposerUpdate::from(
self.inner
.lock()
Expand Down

0 comments on commit 2ed5d77

Please sign in to comment.