Skip to content

Commit

Permalink
update for 3.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sergey-K committed Sep 19, 2022
1 parent b049967 commit 851e51e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
5 changes: 5 additions & 0 deletions Core/UDSocketResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//
import Foundation
import MarkdownKit
import SwiftSoup

class UDSocketResponse {

Expand Down Expand Up @@ -466,6 +467,10 @@ class UDSocketResponse {
text = text.udRemoveFirstSymbol(with: "\n")
text = text.udRemoveLastSymbol(with: "\u{200b}")
text = text.udRemoveLastSymbol(with: "\n")
do {
let doc: Document = try SwiftSoup.parse(text)
text = try doc.text()
} catch {}
let textBeforeRemoveMarkdownUrls = text
var textWithoutLinkImage: String? = nil
let linksImage = text.udRemoveMarkdownUrlsAndReturnLinks()
Expand Down
2 changes: 1 addition & 1 deletion Core/UseDeskSDKHelp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UseDeskSDKHelp {
let payload: [String : Any] = [
"sdk" : "iOS",
"type" : "sdk",
"version" : "3.1.5",
"version" : "3.1.6",
"message_limit" : countMessagesOnInit
]
var dic = [
Expand Down
12 changes: 6 additions & 6 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PODS:
- Socket.IO-Client-Swift (16.0.1):
- Starscream (~> 4.0)
- Starscream (4.0.4)
- SwiftyMarkdown (1.2.4)
- SwiftSoup (2.4.3)
- Texture (3.1.0):
- Texture/AssetsLibrary (= 3.1.0)
- Texture/Core (= 3.1.0)
Expand All @@ -42,12 +42,12 @@ PODS:
- Texture/Core
- Texture/Video (3.1.0):
- Texture/Core
- UseDesk_SDK_Swift (3.1.2):
- UseDesk_SDK_Swift (3.1.4):
- Alamofire (~> 5)
- MarkdownKit
- ReachabilitySwift
- Socket.IO-Client-Swift (~> 16.0)
- SwiftyMarkdown
- SwiftSoup
- Texture

DEPENDENCIES:
Expand All @@ -65,7 +65,7 @@ SPEC REPOS:
- ReachabilitySwift
- Socket.IO-Client-Swift
- Starscream
- SwiftyMarkdown
- SwiftSoup
- Texture

EXTERNAL SOURCES:
Expand All @@ -82,9 +82,9 @@ SPEC CHECKSUMS:
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
Socket.IO-Client-Swift: c116d6dc9fd6be9c259bacfe143f8725bce7d79e
Starscream: 5178aed56b316f13fa3bc55694e583d35dd414d9
SwiftyMarkdown: 7cdec87c6ab5cd9ea0e22ced288e889960649ba5
SwiftSoup: 3384f2e618cfc1b3cbc7852c16692fe8de13fb8f
Texture: 2e8ab2519452515f7f5a520f5a8f7e0a413abfa3
UseDesk_SDK_Swift: e2df8e91e75702b829028fd882b58fe5df65725f
UseDesk_SDK_Swift: e417f2515e25827c2a1878e008f1d76179b296c0

PODFILE CHECKSUM: 38ca86b4f5802b67eb523063e3dd15ab9ab41411

Expand Down
8 changes: 4 additions & 4 deletions Example/UseDesk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"${BUILT_PRODUCTS_DIR}/ReachabilitySwift/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/Socket.IO-Client-Swift/SocketIO.framework",
"${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyMarkdown/SwiftyMarkdown.framework",
"${BUILT_PRODUCTS_DIR}/SwiftSoup/SwiftSoup.framework",
"${BUILT_PRODUCTS_DIR}/Texture/AsyncDisplayKit.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -358,7 +358,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SocketIO.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Starscream.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyMarkdown.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftSoup.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AsyncDisplayKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -589,7 +589,7 @@
INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1.4;
MARKETING_VERSION = 3.1.6;
MODULE_NAME = ExampleApp;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru;
Expand Down Expand Up @@ -621,7 +621,7 @@
INFOPLIST_FILE = "UseDesk/UseDesk-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 3.1.4;
MARKETING_VERSION = 3.1.6;
MODULE_NAME = ExampleApp;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = UseDeskExampleSDK.ru;
Expand Down
13 changes: 10 additions & 3 deletions UseDesk/Classes/UDTextMessageCellNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protocol TextMessageCellNodeDelegate: AnyObject {
class UDTextMessageCellNode: UDMessageCellNode {

private var isOutgoing = false
private var textMessageNode = ASTextNode()
private var textMessageNode = ASTextNode()
private var tableButtonsNode = ASTableNode()

weak var delegateText: TextMessageCellNodeDelegate?
Expand All @@ -29,12 +29,19 @@ class UDTextMessageCellNode: UDMessageCellNode {
self.isOutgoing = message.outgoing
self.message = message
let messageStyle = configurationStyle.messageStyle
let linkColor = message.outgoing ? messageStyle.linkOutgoingColor : messageStyle.linkIncomingColor

var attributedString = NSMutableAttributedString()
let markdownParser = MarkdownParser(font: messageStyle.font, color: message.outgoing ? messageStyle.textOutgoingColor : messageStyle.textIncomingColor)
markdownParser.link.color = message.outgoing ? messageStyle.linkOutgoingColor : messageStyle.linkIncomingColor
attributedString = NSMutableAttributedString(attributedString: markdownParser.parse(message.text))

attributedString.enumerateAttributes(in: NSRange(0..<attributedString.length), options: []) { (attributes, range, _) -> Void in
for (attribute, _) in attributes {
if attribute == .link {
attributedString.addAttribute(.foregroundColor, value: linkColor, range: range)
attributedString.addAttribute(.underlineColor, value: linkColor, range: range)
}
}
}
textMessageNode.attributedText = attributedString
textMessageNode.isUserInteractionEnabled = true
textMessageNode.delegate = self
Expand Down
3 changes: 2 additions & 1 deletion UseDesk_SDK_Swift.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'UseDesk_SDK_Swift'
s.version = '3.1.5'
s.version = '3.1.6'
s.summary = 'A short description of UseDesk.'

s.homepage = 'https://github.com/usedesk/UseDeskSwift'
Expand All @@ -26,5 +26,6 @@ Pod::Spec.new do |s|
s.dependency 'MarkdownKit'
s.dependency 'Texture'
s.dependency 'ReachabilitySwift'
s.dependency 'SwiftSoup'

end

0 comments on commit 851e51e

Please sign in to comment.