Commit 9d916f3e authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Kateryna Kostiuk

swarm: use QString for conversation id and interaction id

Change-Id: I6541cacc9998e77bad938c708dd395ecc0075804
parent 5f30cfbb
......@@ -255,7 +255,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNet
QObject::connect(&lrc->getBehaviorController(),
&lrc::api::BehaviorController::newUnreadInteraction,
[self] (const QString& accountId, const QString& conversation,
uint64_t interactionId, const lrc::api::interaction::Info& interaction) {
const QString& interactionId, const lrc::api::interaction::Info& interaction) {
BOOL shouldNotify = [[NSUserDefaults standardUserDefaults] boolForKey:Preferences::MessagesNotifications];
if(!shouldNotify) {
return;
......
......@@ -296,7 +296,7 @@ CVPixelBufferRef pixelBufferPreview;
self.messageConnection = QObject::connect(convModel,
&lrc::api::ConversationModel::interactionStatusUpdated,
[self] (const QString& convUid,
uint64_t msgId,
const QString& msgId,
lrc::api::interaction::Info msg) {
if (msg.type == lrc::api::interaction::Type::TEXT) {
if(not [[self splitView] isSubviewCollapsed:[[[self splitView] subviews] objectAtIndex: 1]]){
......
......@@ -218,7 +218,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
return cachedConv_;
}
-(void) reloadConversationForMessage:(uint64_t) uid updateSize:(BOOL) update {
-(void) reloadConversationForMessage:(const QString&) uid updateSize:(BOOL) update {
auto* conv = [self getCurrentConversation];
if (conv == nil)
return;
......@@ -275,8 +275,8 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
&lrc::api::ConversationModel::displayedInteractionChanged,
[self](const QString &uid,
const QString &participantURI,
const uint64_t &previousUid,
const uint64_t &newdUid) {
const QString &previousUid,
const QString &newdUid) {
if (uid != convUid_)
return;
[self reloadConversationForMessage:newdUid updateSize: NO];
......@@ -322,7 +322,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
}
});
newInteractionSignal_ = QObject::connect(convModel_, &lrc::api::ConversationModel::newInteraction,
[self](const QString& uid, uint64_t interactionId, const lrc::api::interaction::Info& interaction){
[self](const QString& uid, QString& interactionId, const lrc::api::interaction::Info& interaction){
if (uid != convUid_)
return;
cachedConv_ = nil;
......@@ -332,7 +332,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
[self scrollToBottom];
});
interactionStatusUpdatedSignal_ = QObject::connect(convModel_, &lrc::api::ConversationModel::interactionStatusUpdated,
[self](const QString& uid, uint64_t interactionId, const lrc::api::interaction::Info& interaction){
[self](const QString& uid, const QString& interactionId, const lrc::api::interaction::Info& interaction){
if (uid != convUid_)
return;
cachedConv_ = nil;
......@@ -430,7 +430,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
return result;
}
-(NSTableCellView*) configureViewforTransfer:(lrc::api::interaction::Info)interaction interactionID: (uint64_t) interactionID tableView:(NSTableView*)tableView
-(NSTableCellView*) configureViewforTransfer:(lrc::api::interaction::Info)interaction interactionID: (const QString&) interactionID tableView:(NSTableView*)tableView
{
IMTableCellView* result;
......@@ -920,7 +920,7 @@ typedef NS_ENUM(NSInteger, MessageSequencing) {
#pragma mark - message view parameters
-(NSString *) getDataTransferPath:(uint64_t)interactionId {
-(NSString *) getDataTransferPath:(const QString&)interactionId {
lrc::api::datatransfer::Info info = {};
convModel_->getTransferInfo(interactionId, info);
double convertData = static_cast<double>(info.totalSize);
......
......@@ -317,13 +317,13 @@ NSInteger const REQUEST_SEG = 1;
[delegate listTypeChanged];
});
interactionStatusUpdatedConnection_ = QObject::connect(convModel_, &lrc::api::ConversationModel::interactionStatusUpdated,
[self] (const QString& convUid) {
[self] (const QString& convUid, const QString& interactionId) {
if (convUid != selectedUid_)
return;
[self reloadConversationWithUid: convUid.toNSString()];
});
newInteractionConnection_ = QObject::connect(convModel_, &lrc::api::ConversationModel::newInteraction,
[self](const QString& convUid, uint64_t interactionId, const lrc::api::interaction::Info& interaction){
[self](const QString& convUid, QString& interactionId, const lrc::api::interaction::Info& interaction){
if (convUid == selectedUid_) {
convModel_->clearUnreadInteractions(convUid);
}
......
......@@ -20,6 +20,7 @@
#import <Cocoa/Cocoa.h>
#import "MessageBubbleView.h"
#import <qstring.h>
@interface IMTableCellView : NSTableCellView
......@@ -47,9 +48,9 @@
@property (nonatomic, strong) IBOutlet NSButton* openFileButton;
@property (copy) void (^onRightClick)(NSEvent* event);
- (uint64_t) interaction;
- (void) setupForInteraction:(uint64_t)inter isFailed:(bool) failed;
- (void) setupForInteraction:(uint64_t)inter;
- (QString&) interaction;
- (void) setupForInteraction:(const QString&)inter isFailed:(bool) failed;
- (void) setupForInteraction:(const QString&)inter;
- (void) updateMessageConstraint:(CGFloat) width andHeight: (CGFloat) height timeIsVisible: (bool) visible isTopPadding: (bool) padding;
- (void)updateWidthConstraints:(CGFloat)width;
- (void)updateHeightConstraints:(CGFloat)height;
......
......@@ -21,10 +21,10 @@
#import "IMTableCellView.h"
#import "NSColor+RingTheme.h"
#import <QuartzCore/QuartzCore.h>
#import <qstring.h>
@implementation IMTableCellView {
uint64_t interaction;
QString interaction;
}
NSString* const MESSAGE_MARGIN = @"10";
......@@ -53,7 +53,7 @@ NSString* const TIME_BOX_HEIGHT = @"34";
}
}
- (void) setupForInteraction:(uint64_t)inter
- (void) setupForInteraction:(const QString&)inter
{
interaction = inter;
[self setupDirection];
......@@ -67,7 +67,7 @@ NSString* const TIME_BOX_HEIGHT = @"34";
msgView.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay;
}
- (void) setupForInteraction:(uint64_t)inter isFailed:(bool) failed {
- (void) setupForInteraction:(const QString&)inter isFailed:(bool) failed {
[self setupForInteraction:inter];
}
......@@ -105,7 +105,7 @@ NSString* const TIME_BOX_HEIGHT = @"34";
[self updateWidthConstraints: size.width];
}
- (uint64_t)interaction
- (QString&)interaction
{
return interaction;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment