...
 
Commits (2)
......@@ -312,7 +312,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
NSTextField* timeField = [result viewWithTag:GENERIC_INT_TIME_TAG];
// TODO: Fix symbol in LRC
NSString* fixedString = [text stringByReplacingOccurrencesOfString:@"🕽" withString:@"📞"];
NSString* fixedString = [[text stringByReplacingOccurrencesOfString:@"🕽" withString:@""] stringByReplacingOccurrencesOfString:@"📞" withString:@""];
[textField setStringValue:fixedString];
[timeField setStringValue:time];
......@@ -786,21 +786,17 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
if ([[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitYear]!= NSOrderedSame) {
return [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterMediumStyle];
return [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterLongStyle timeStyle:NSDateFormatterMediumStyle];
}
if ([[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitDay]!= NSOrderedSame ||
[[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitMonth]!= NSOrderedSame) {
[dateFormatter setDateFormat:@"MMM dd, HH:mm"];
return [dateFormatter stringFromDate:msgTime];
}
[dateFormatter setDateFormat:@"HH:mm"];
return [dateFormatter stringFromDate:msgTime];
return [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle];
}
return [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle];
}
- (void) updateSendMessageHeight {
......
......@@ -119,7 +119,7 @@ previewView, timeLabel, recordOnOffButton, sendButton, fileImage, infoLabel, tim
[view renderWithPixelBuffer: buffer
size: frameSize
rotation: 0
fillFrame: false];
fillFrame: true];
}
}
......@@ -211,11 +211,6 @@ previewView, timeLabel, recordOnOffButton, sendButton, fileImage, infoLabel, tim
[durationTimer invalidate];
durationTimer = nil;
[self setRecordedState];
if(isAudio) {
return;
}
std::string uri = [[@"file:///" stringByAppendingString: fileName] UTF8String];
avModel->setInputFile(uri);
}
-(void) startRecord {
......
......@@ -523,19 +523,26 @@ NSInteger const REQUEST_SEG = 1;
[interactionSnippet setStringValue:lastInteractionSnippetFixedString];
// last interaction date/time
std::time_t lastInteractionTimestamp = conversation.interactions[lastUid].timestamp;
std::time_t now = std::time(nullptr);
char interactionDay[64];
char nowDay[64];
std::strftime(interactionDay, sizeof(interactionDay), "%D", std::localtime(&lastInteractionTimestamp));
std::strftime(nowDay, sizeof(nowDay), "%D", std::localtime(&now));
if (std::string(interactionDay) == std::string(nowDay)) {
char interactionTime[64];
std::strftime(interactionTime, sizeof(interactionTime), "%R", std::localtime(&lastInteractionTimestamp));
[lastInteractionDate setStringValue:[NSString stringWithUTF8String:interactionTime]];
NSString *timeString = @"";
NSDate* msgTime = [NSDate dateWithTimeIntervalSince1970:conversation.interactions[lastUid].timestamp];
NSDate *today = [NSDate date];
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale currentLocale] localeIdentifier]]];
if ([[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitYear]!= NSOrderedSame) {
timeString = [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterNoStyle];
} else if ([[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitDay]!= NSOrderedSame ||
[[NSCalendar currentCalendar] compareDate:today
toDate:msgTime
toUnitGranularity:NSCalendarUnitMonth]!= NSOrderedSame) {
timeString = [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterNoStyle];
} else {
[lastInteractionDate setStringValue:[NSString stringWithUTF8String:interactionDay]];
timeString = [NSDateFormatter localizedStringFromDate:msgTime dateStyle:NSDateFormatterNoStyle timeStyle:NSDateFormatterShortStyle];
}
[lastInteractionDate setStringValue:timeString];
}
return result;
......
......@@ -227,14 +227,14 @@ std::string currentVideoDevice;
[view renderWithPixelBuffer:(CVPixelBufferRef)frame->data[3]
size: frameSize
rotation: rotation
fillFrame: false];
fillFrame: true];
return;
}
else if (CVPixelBufferRef pixBuffer = [self getBufferForPreviewFromFrame:frame]) {
[view renderWithPixelBuffer: pixBuffer
size: frameSize
rotation: rotation
fillFrame: false];
fillFrame: true];
}
}
}
......
......@@ -179,23 +179,10 @@ bool frameDisplayed = false;
float frameRatio = ((float)size.width)/((float)size.height);
simd::float4x4 projectionMatrix;
float ratio = viewRatio * (1/frameRatio);
if((viewRatio >= 1 && frameRatio >= 1) ||
(viewRatio < 1 && frameRatio < 1) ||
(ratio > 0.5 && ratio < 1.5) ) {
if (ratio <= 1.0 && ratio >= 0.5)
projectionMatrix = [self getScalingMatrix: 1/ratio axis: 'x'];
else if (ratio < 0.5)
projectionMatrix = [self getScalingMatrix: ratio axis: 'y'];
else if (ratio > 1 && ratio < 2)
projectionMatrix = [self getScalingMatrix: ratio axis: 'y'];
else
projectionMatrix = [self getScalingMatrix: 1/ratio axis: 'x'];
} else {
if (ratio < 1.0 && !fill || fill && ratio > 1.0)
projectionMatrix = [self getScalingMatrix: ratio axis: 'y'];
else
projectionMatrix = [self getScalingMatrix: 1/ratio axis: 'x'];
}
if (ratio < 1.0 && !fill || fill && ratio > 1.0)
projectionMatrix = [self getScalingMatrix: ratio axis: 'y'];
else
projectionMatrix = [self getScalingMatrix: 1/ratio axis: 'x'];
float radians = (-rotation * M_PI) / 180;
simd::float4x4 rotationMatrix = [self getRotationMatrix:radians];
Uniforms bytes = Uniforms{projectionMatrix: projectionMatrix, rotationMatrix: rotationMatrix};
......