Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
linphone-iphone
Commits
f47eb4f2
Commit
f47eb4f2
authored
May 12, 2021
by
DanmeiChen
Browse files
fix unsupported format
parent
600fdc1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
Classes/LinphoneUI/UIChatBubblePhotoCell.m
Classes/LinphoneUI/UIChatBubblePhotoCell.m
+16
-8
Classes/LinphoneUI/UIChatBubbleTextCell.m
Classes/LinphoneUI/UIChatBubbleTextCell.m
+1
-1
No files found.
Classes/LinphoneUI/UIChatBubblePhotoCell.m
View file @
f47eb4f2
...
...
@@ -93,6 +93,8 @@
}
[
super
setChatMessageForCbs
:
amessage
];
[
LinphoneManager
setValueInMessageAppData
:
NULL
forKey
:
@"encryptedfile"
inMessage
:
self
.
message
];
[
LinphoneManager
setValueInMessageAppData
:
NULL
forKey
:
@"encryptedfiles"
inMessage
:
self
.
message
];
}
-
(
void
)
loadImageAsset
:(
PHAsset
*
)
asset
image
:
(
UIImage
*
)
image
{
...
...
@@ -183,7 +185,11 @@
if
(
filePath
==
NULL
)
{
char
*
cPath
=
linphone_content_get_plain_file_path
(
content
);
if
(
cPath
)
{
NSString
*
filePath
=
[
NSString
stringWithUTF8String
:
cPath
];
if
(
strcmp
(
cPath
,
""
)
!=
0
)
{
NSString
*
tempPath
=
[
NSString
stringWithUTF8String
:
cPath
];
filePath
=
[
tempPath
stringByDeletingPathExtension
];
[[
NSFileManager
defaultManager
]
moveItemAtPath
:
tempPath
toPath
:
filePath
error
:
nil
];
}
ms_free
(
cPath
);
[
encrptedFilePaths
setValue
:
filePath
forKey
:
name
];
}
...
...
@@ -245,13 +251,15 @@
NSString
*
fileName
=
[
NSString
stringWithUTF8String
:
linphone_content_get_name
(
fileContent
)];
if
(
!
filePath
)
{
if
(
self
.
vfsEnabled
)
{
char
*
cPath
=
self
.
vfsEnabled
?
linphone_content_get_plain_file_path
(
fileContent
)
:
NULL
;
if
(
cPath
)
{
file
Path
=
[
NSString
stringWithUTF8String
:
cPath
];
ms_free
(
cPath
)
;
[
Linphon
eManager
setValueInMessageAppData
:
filePath
forKey
:
@"encryptedfile"
inMessage
:
self
.
message
];
char
*
cPath
=
self
.
vfsEnabled
?
linphone_content_get_plain_file_path
(
fileContent
)
:
NULL
;
if
(
cPath
)
{
if
(
strcmp
(
cPath
,
""
)
!=
0
)
{
NSString
*
temp
Path
=
[
NSString
stringWithUTF8String
:
cPath
];
filePath
=
[
tempPath
stringByDeletingPathExtension
]
;
[
[
NSFil
eManager
defaultManager
]
moveItemAtPath
:
tempPath
toPath
:
filePath
error
:
nil
];
}
ms_free
(
cPath
);
[
LinphoneManager
setValueInMessageAppData
:
filePath
forKey
:
@"encryptedfile"
inMessage
:
self
.
message
];
}
else
{
filePath
=
[[
LinphoneManager
cacheDirectory
]
stringByAppendingPathComponent
:
fileName
];
}
...
...
@@ -475,7 +483,7 @@
ChatConversationView
*
view
=
VIEW
(
ChatConversationView
);
NSString
*
filePath
=
[
LinphoneManager
getMessageAppDataForKey
:
@"encryptedfile"
inMessage
:
self
.
message
];
if
(
filePath
)
{
[
view
openFileWithURL
:[
NSURL
URLWith
String
:
filePath
]];
[
view
openFileWithURL
:[
NSURL
file
URLWith
Path
:
filePath
]];
return
;
}
NSString
*
name
=
[
LinphoneManager
getMessageAppDataForKey
:
@"localfile"
inMessage
:
self
.
message
];
...
...
Classes/LinphoneUI/UIChatBubbleTextCell.m
View file @
f47eb4f2
...
...
@@ -582,7 +582,7 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 44;
}
originalImageSize
=
image
.
size
;
}
else
if
(
localVideo
&&
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:
filePath
])
{
UIImage
*
image
=
[
UIChatBubbleTextCell
getImageFromVideoUrl
:[
NSURL
URLWith
String
:
filePath
]];
UIImage
*
image
=
[
UIChatBubbleTextCell
getImageFromVideoUrl
:[
NSURL
file
URLWith
Path
:
filePath
]];
if
(
!
image
)
{
return
[
self
ViewHeightForFile
:
width
];
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment