mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-04 06:58:20 +02:00
Groups: self-management of membership of groups
- Improve group details display vector-im/riot-meta#114
This commit is contained in:
@@ -154,8 +154,15 @@
|
||||
|
||||
if (_group)
|
||||
{
|
||||
// Force refresh
|
||||
// Force a screen refresh
|
||||
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
|
||||
|
||||
// Trigger a refresh on the group summary.
|
||||
[self.mxSession updateGroupSummary:_group success:nil failure:^(NSError *error) {
|
||||
|
||||
NSLog(@"[GroupHomeViewController] viewWillAppear: group summary update failed %@", _group.groupId);
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +207,7 @@
|
||||
{
|
||||
[self cancelRegistrationOnGroupChangeNotifications];
|
||||
|
||||
//@TODO
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didUpdateGroupSummary:) name:kMXSessionDidUpdateGroupSummaryNotification object:self.mxSession];
|
||||
}
|
||||
|
||||
- (void)cancelRegistrationOnGroupChangeNotifications
|
||||
@@ -209,6 +216,11 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)didUpdateGroupSummary:(NSNotification *)notif
|
||||
{
|
||||
[self refreshDisplayWithGroup:[self.mxSession groupWithGroupId:_group.groupId]];
|
||||
}
|
||||
|
||||
- (void)refreshDisplayWithGroup:(MXGroup*)group
|
||||
{
|
||||
_group = group;
|
||||
@@ -261,7 +273,12 @@
|
||||
_separatorViewTopConstraint.constant = 0;
|
||||
}
|
||||
|
||||
_groupLongDescription.text = _group.summary.profile.longDescription;
|
||||
if (_group.summary.profile.longDescription.length)
|
||||
{
|
||||
//@TODO: implement a specific html renderer to support h1/h2 and handle the Matrix media content URI (in the form of "mxc://...").
|
||||
MXKEventFormatter *eventFormatter = [[MXKEventFormatter alloc] initWithMatrixSession:self.mxSession];
|
||||
_groupLongDescription.attributedText = [eventFormatter renderHTMLString:_group.summary.profile.longDescription forEvent:nil];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user