Commit 894ce42722

894ce4272251a2276706d320123dac05dd537bbf

parent: 4538219daf

Unsigned

Denis Kasak <dkasak@termina.org.uk> · 2020-06-29 11:02 UTC

Comments (add TODO, fix docstring).

Layout: unified · split

src/render.rs +5 −1
@@ -18,6 +18,10 @@ pub(crate) trait RenderableEvent {
1818 /// Convert the event into a string that will be displayed in the UI.
1919 /// The displayname is taken as a parameter since it cannot be calculated from the event
2020 /// context alone.
21 // TODO: This should probably also return tags instead just a string.
22 //
23 // Additionally, the render method should probably accept a RoomMember instead of a display
24 // name. Then the sender method can be removed.
2125 fn render(&self, displayname: &str) -> String;
2226
2327 /// Get the sender for this event this can be used to get the displayname.
@@ -215,7 +219,7 @@ macro_rules! has_formatted_body {
215219}
216220
217221/// This trait is implemented for message types that can contain either an URL or an encrypted
218/// file. One of both _must_ be present.
222/// file. One of these _must_ be present.
219223trait HasUrlOrFile {
220224 fn url(&self) -> Option<&str>;
221225 fn file(&self) -> Option<&str>;