mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Add Transfer Feature
This commit is contained in:
parent
0ed5d8e371
commit
4db1c328d9
4 changed files with 11 additions and 8 deletions
|
|
@ -20,7 +20,7 @@
|
|||
#import "ChatsListTableView.h"
|
||||
#import "UIChatCell.h"
|
||||
#import "FileTransferDelegate.h"
|
||||
|
||||
#import "linphoneapp-Swift.h"
|
||||
#import "linphone/linphonecore.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "Utils.h"
|
||||
|
|
@ -213,7 +213,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo
|
|||
|
||||
[cell setChatRoom:(LinphoneChatRoom *)bctbx_list_nth_data(_data, (int)[indexPath row])];
|
||||
[super accessoryForCell:cell atPath:indexPath];
|
||||
BOOL forwardMode = VIEW(ChatConversationView).pendingForwardMessage != nil;
|
||||
BOOL forwardMode = VIEW(ChatConversationViewSwift).pendingForwardMessage != nil;
|
||||
cell.forwardIcon.hidden = !forwardMode;
|
||||
if (forwardMode) {
|
||||
cell.ephemeral.hidden = true;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
if(dict||dictFile||dictUrl) VIEW(ChatConversationView).sharingMedia = TRUE;
|
||||
|
||||
if(VIEW(ChatConversationView).sharingMedia == nil){
|
||||
forwardMode = VIEW(ChatConversationView).pendingForwardMessage != nil;
|
||||
forwardMode = VIEW(ChatConversationViewSwift).pendingForwardMessage != nil;
|
||||
}else{
|
||||
forwardMode = VIEW(ChatConversationView).sharingMedia != nil;
|
||||
}
|
||||
|
|
@ -202,7 +202,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (IBAction)onCancelForwardClicked:(id)sender {
|
||||
VIEW(ChatConversationView).sharingMedia = nil;
|
||||
VIEW(ChatConversationView).pendingForwardMessage = nil;
|
||||
VIEW(ChatConversationViewSwift).pendingForwardMessage = nil;
|
||||
NSString* groupName = [NSString stringWithFormat:@"group.%@.linphoneExtension",[[NSBundle mainBundle] bundleIdentifier]];
|
||||
NSUserDefaults *defaults = [[NSUserDefaults alloc] initWithSuiteName:groupName];
|
||||
[defaults removeObjectForKey:@"photoData"];
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ static const CGFloat REPLY_OR_FORWARD_TAG_HEIGHT = 18;
|
|||
[_messageActionsIcons addObject:@"menu_forward_default"];
|
||||
[_messageActionsBlocks addObject:^{
|
||||
[thiz dismissPopup];
|
||||
VIEW(ChatConversationView).pendingForwardMessage = message;
|
||||
VIEW(ChatConversationViewSwift).pendingForwardMessage = message;
|
||||
[PhoneMainView.instance changeCurrentView:VIEW(ChatsListView).compositeViewDescription];
|
||||
}];
|
||||
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ import AVFoundation
|
|||
var data : [Data?] = []
|
||||
var mediaCount : Int = 0
|
||||
var newMediaCount : Int = 0
|
||||
@objc var pendingForwardMessage : OpaquePointer? = nil
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
|
@ -203,6 +204,8 @@ import AVFoundation
|
|||
self.messageView.pictureButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
self.handlePendingTransferIfAny()
|
||||
}
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
|
|
@ -1297,7 +1300,7 @@ import AVFoundation
|
|||
}
|
||||
|
||||
func handlePendingTransferIfAny() {
|
||||
if pendingForwardMessage {
|
||||
if (pendingForwardMessage != nil) {
|
||||
let message = pendingForwardMessage
|
||||
pendingForwardMessage = nil
|
||||
let d = UIConfirmationDialog.show(
|
||||
|
|
@ -1307,10 +1310,10 @@ import AVFoundation
|
|||
onCancelClick: {
|
||||
},
|
||||
onConfirmationClick: {
|
||||
linphone_chat_message_send(linphone_chat_room_create_forward_message(chatRoom, message))
|
||||
linphone_chat_message_send(linphone_chat_room_create_forward_message(self.chatRoom?.getCobject, message))
|
||||
|
||||
})
|
||||
d?.forwardImage.hidden = false
|
||||
d?.forwardImage.isHidden = false
|
||||
d?.setSpecialColor()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue