mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 11:30:50 +02:00
Feature/4382 performance send message
This commit is contained in:
@@ -1393,6 +1393,10 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
if (readyToSend)
|
||||
{
|
||||
// bwi: evaluate send message performance
|
||||
PerformanceProfile *sendTextMessageProfile = [[PerformanceProfile alloc] initWithThreshold:BWIBuildSettings.shared.sendMessageThreshold];
|
||||
[sendTextMessageProfile startMeasurement];
|
||||
|
||||
// The event modified is always fetch from the actual data source
|
||||
MXEvent *eventModified = [self.roomDataSource eventWithEventId:self.customizedRoomDataSource.selectedEventId];
|
||||
|
||||
@@ -1401,25 +1405,36 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
[self setupRoomDataSourceToResolveEvent:^(MXKRoomDataSource *roomDataSource) {
|
||||
if (self.inputToolBarSendMode == RoomInputToolbarViewSendModeReply && eventModified)
|
||||
{
|
||||
[roomDataSource sendReplyToEvent:eventModified withTextMessage:msgTxt success:nil failure:^(NSError *error) {
|
||||
[roomDataSource sendReplyToEvent:eventModified withTextMessage:msgTxt success:^(NSString *string)
|
||||
{
|
||||
[self finishTextMessageProfil:sendTextMessageProfile];
|
||||
} failure:^(NSError *error) {
|
||||
// Just log the error. The message will be displayed in red in the room history
|
||||
MXLogDebug(@"[MXKRoomViewController] sendTextMessage failed.");
|
||||
[sendTextMessageProfile abortMeasurement];
|
||||
}];
|
||||
}
|
||||
else if (self.inputToolBarSendMode == RoomInputToolbarViewSendModeEdit && eventModified)
|
||||
{
|
||||
[roomDataSource replaceTextMessageForEvent:eventModified withTextMessage:msgTxt success:nil failure:^(NSError *error) {
|
||||
// Just log the error. The message will be displayed in red
|
||||
[roomDataSource replaceTextMessageForEvent:eventModified withTextMessage:msgTxt success:^(NSString *string)
|
||||
{
|
||||
[self finishTextMessageProfil:sendTextMessageProfile];
|
||||
} failure:^(NSError *error) {
|
||||
// Just log the error. The message will be displayed in red in the room history
|
||||
MXLogDebug(@"[MXKRoomViewController] sendTextMessage failed.");
|
||||
[sendTextMessageProfile abortMeasurement];
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Let the datasource send it and manage the local echo
|
||||
[roomDataSource sendTextMessage:msgTxt success:nil failure:^(NSError *error)
|
||||
[roomDataSource sendTextMessage:msgTxt success:^(NSString *string)
|
||||
{
|
||||
[self finishTextMessageProfil:sendTextMessageProfile];
|
||||
} failure:^(NSError *error) {
|
||||
// Just log the error. The message will be displayed in red in the room history
|
||||
MXLogDebug(@"[MXKRoomViewController] sendTextMessage failed.");
|
||||
[sendTextMessageProfile abortMeasurement];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -8125,6 +8140,7 @@ static CGSize kThreadListBarButtonItemImageSize;
|
||||
|
||||
}];
|
||||
}
|
||||
[BWIAnalytics.sharedTracker trackEvent:@"Session" action:@"No DIMENSION"];
|
||||
}
|
||||
|
||||
#pragma mark - BWI Emoji History
|
||||
|
||||
Reference in New Issue
Block a user