mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix Chat room
This commit is contained in:
parent
fb746aba5c
commit
29ea5d04fb
8 changed files with 30 additions and 32 deletions
|
|
@ -110,7 +110,11 @@
|
|||
[avatarImage setImage:image];
|
||||
|
||||
// Message
|
||||
[chatContentLabel setText:[chat message]];
|
||||
if([chat isExternalImage] || [chat isInternalImage]) {
|
||||
[chatContentLabel setText:@""];
|
||||
} else {
|
||||
[chatContentLabel setText:[chat message]];
|
||||
}
|
||||
|
||||
linphone_address_destroy(linphoneAddress);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ static UIFont *CELL_FONT = nil;
|
|||
owner:self
|
||||
options:nil];
|
||||
[self addSubview:innerView];
|
||||
[deleteButton setAlpha:0.0f];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
@ -101,14 +102,14 @@ static UIFont *CELL_FONT = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
if([UIChatRoomCell isExternalImage:[chat message]]) {
|
||||
if([chat isExternalImage]) {
|
||||
[messageLabel setHidden:TRUE];
|
||||
|
||||
[messageImageView setImage:nil];
|
||||
[messageImageView setHidden:TRUE];
|
||||
|
||||
[downloadButton setHidden:FALSE];
|
||||
} else if([UIChatRoomCell isInternalImage:[chat message]]) {
|
||||
} else if([chat isInternalImage]) {
|
||||
[messageLabel setHidden:TRUE];
|
||||
|
||||
[[LinphoneManager instance].photoLibrary assetForURL:[NSURL URLWithString:[chat message]] resultBlock:^(ALAsset *asset) {
|
||||
|
|
@ -176,17 +177,9 @@ static UIFont *CELL_FONT = nil;
|
|||
}
|
||||
}
|
||||
|
||||
+ (BOOL)isExternalImage:(NSString *)message {
|
||||
return [message hasPrefix:@"http:"] || [message hasPrefix:@"https:"];
|
||||
}
|
||||
|
||||
+ (BOOL)isInternalImage:(NSString *)message {
|
||||
return [message hasPrefix:@"assets-library:"];
|
||||
}
|
||||
|
||||
+ (CGSize)viewSize:(ChatModel*)chat width:(int)width {
|
||||
CGSize messageSize;
|
||||
if(!([UIChatRoomCell isExternalImage:[chat message]] || [UIChatRoomCell isInternalImage:[chat message]])) {
|
||||
if(!([chat isExternalImage] || [chat isInternalImage])) {
|
||||
if(CELL_FONT == nil) {
|
||||
CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@
|
|||
@property (copy) NSNumber *read;
|
||||
@property (copy) NSNumber *state;
|
||||
|
||||
- (BOOL)isExternalImage;
|
||||
- (BOOL)isInternalImage;
|
||||
|
||||
- (void)create;
|
||||
+ (ChatModel*)read:(NSNumber*)id;
|
||||
- (void)update;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,15 @@
|
|||
}
|
||||
|
||||
|
||||
- (BOOL)isExternalImage {
|
||||
return [message hasPrefix:@"http:"] || [message hasPrefix:@"https:"];
|
||||
}
|
||||
|
||||
- (BOOL)isInternalImage {
|
||||
return [message hasPrefix:@"assets-library:"];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - CRUD Functions
|
||||
|
||||
- (void)create {
|
||||
|
|
|
|||
|
|
@ -246,10 +246,7 @@
|
|||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="787000581"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIBackgroundColor" ref="460939904"/>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<reference key="IBUIImage" ref="172588711"/>
|
||||
|
|
@ -271,7 +268,6 @@
|
|||
<string key="NSFrame">{{250, 0}, {70, 59}}</string>
|
||||
<reference key="NSSuperview" ref="833509359"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
|
||||
|
|
|
|||
|
|
@ -236,10 +236,7 @@
|
|||
<reference key="NSSuperview" ref="833509359"/>
|
||||
<reference key="NSNextKeyView" ref="787000581"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIBackgroundColor" ref="460939904"/>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<reference key="IBUIImage" ref="172588711"/>
|
||||
|
|
|
|||
|
|
@ -212,17 +212,17 @@
|
|||
<dict>
|
||||
<key>backup</key>
|
||||
<dict>
|
||||
<key>16</key>
|
||||
<key>17</key>
|
||||
<dict>
|
||||
<key>class</key>
|
||||
<string>BLWrapperHandle</string>
|
||||
<key>name</key>
|
||||
<string>Classes/ChatRoomViewController/16/ChatRoomViewController.xib</string>
|
||||
<string>Classes/ChatRoomViewController/17/ChatRoomViewController.xib</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>change date</key>
|
||||
<date>2012-09-18T13:03:28Z</date>
|
||||
<date>2012-09-18T15:40:57Z</date>
|
||||
<key>changed values</key>
|
||||
<array/>
|
||||
<key>class</key>
|
||||
|
|
@ -232,7 +232,7 @@
|
|||
<key>flags</key>
|
||||
<integer>0</integer>
|
||||
<key>hash</key>
|
||||
<string>fb9acb898a88e8d219dfd663e9b8eb19
|
||||
<string>0d54842000213c11a77cc9d1e2698245
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>ChatRoomViewController.xib</string>
|
||||
|
|
@ -568,9 +568,9 @@
|
|||
<key>versions</key>
|
||||
<dict>
|
||||
<key>en</key>
|
||||
<string>16</string>
|
||||
<string>17</string>
|
||||
<key>fr</key>
|
||||
<string>16</string>
|
||||
<string>17</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
|
|
|
|||
|
|
@ -246,10 +246,7 @@
|
|||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="787000581"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA</bytes>
|
||||
</object>
|
||||
<reference key="IBUIBackgroundColor" ref="460939904"/>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<reference key="IBUIImage" ref="172588711"/>
|
||||
|
|
@ -271,7 +268,6 @@
|
|||
<string key="NSFrame">{{250, 0}, {70, 59}}</string>
|
||||
<reference key="NSSuperview" ref="833509359"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
|
||||
Loading…
Add table
Reference in a new issue