diff --git a/app/mobile/ios/Databag.xcodeproj/project.pbxproj b/app/mobile/ios/Databag.xcodeproj/project.pbxproj
index c36d2958..6c790877 100644
--- a/app/mobile/ios/Databag.xcodeproj/project.pbxproj
+++ b/app/mobile/ios/Databag.xcodeproj/project.pbxproj
@@ -507,7 +507,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Databag/Databag.entitlements;
- CURRENT_PROJECT_VERSION = 34;
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3P65PQ7SUR;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Databag/Info.plist;
@@ -516,7 +516,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 1.9;
+ MARKETING_VERSION = 1.10;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -541,7 +541,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Databag/Databag.entitlements;
- CURRENT_PROJECT_VERSION = 34;
+ CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3P65PQ7SUR;
INFOPLIST_FILE = Databag/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = Databag;
@@ -549,7 +549,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 1.9;
+ MARKETING_VERSION = 1.10;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -571,7 +571,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++17";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -643,7 +643,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
- CLANG_CXX_LANGUAGE_STANDARD = "c++17";
+ CLANG_CXX_LANGUAGE_STANDARD = "c++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
diff --git a/app/mobile/ios/Databag/Info.plist b/app/mobile/ios/Databag/Info.plist
index 56ac4eff..86510025 100644
--- a/app/mobile/ios/Databag/Info.plist
+++ b/app/mobile/ios/Databag/Info.plist
@@ -21,7 +21,7 @@
CFBundleSignature
????
CFBundleVersion
- 34
+ 1
LSRequiresIPhoneOS
NSAppTransportSecurity
diff --git a/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js b/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js
index e47e0b9b..dc7e21a3 100644
--- a/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js
+++ b/app/mobile/src/session/conversation/topicItem/useTopicItem.hook.js
@@ -200,21 +200,24 @@ export function useTopicItem(item, hosting, remove, contentKey) {
};
const clickableText = (text) => {
- var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
+ const urlPatternn = new RegExp('^(https?:\\/\\/)?'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
+ const hostPattern = new RegExp('^https?:\\/\\/', 'i');
+
let clickable = [];
let group = '';
const words = text == null ? [''] : text.split(' ');
words.forEach((word, index) => {
- if (!!pattern.test(word)) {
+ if (!!urlPatternn.test(word)) {
clickable.push({ group });
group = '';
- clickable.push( Linking.openURL(sanitizeUrl(word))} style={{ fontStyle: 'italic' }}>{ sanitizeUrl(word) + ' ' });
+ const url = !!hostPattern.test(word) ? word : `https://${word}`;
+ clickable.push( Linking.openURL(sanitizeUrl(url))} style={{ fontStyle: 'italic' }}>{ sanitizeUrl(word) + ' ' });
}
else {
group += `${word} `;
diff --git a/net/web/src/access/login/useLogin.hook.js b/net/web/src/access/login/useLogin.hook.js
index 0672a791..f9be90d0 100644
--- a/net/web/src/access/login/useLogin.hook.js
+++ b/net/web/src/access/login/useLogin.hook.js
@@ -1,7 +1,7 @@
import { useContext, useState, useEffect } from 'react';
import { AppContext } from 'context/AppContext';
import { getAvailable } from 'api/getAvailable';
-import { useNavigate } from "react-router-dom";
+import { useLocation, useNavigate } from "react-router-dom";
export function useLogin() {
@@ -14,6 +14,7 @@ export function useLogin() {
});
const navigate = useNavigate();
+ const { search } = useLocation();
const app = useContext(AppContext);
const updateState = (value) => {
@@ -69,6 +70,30 @@ export function useLogin() {
// eslint-disable-next-line
}, [])
+ const access = async (token) => {
+ if (!state.busy) {
+ updateState({ busy: true });
+ try {
+ await app.actions.access(token);
+ }
+ catch (err) {
+ console.log(err);
+ updateState({ busy: false });
+ throw new Error('access failed: check your token');
+ }
+ updateState({ busy: false });
+ }
+ }
+
+ useEffect(() => {
+ let params = new URLSearchParams(search);
+ let token = params.get("access");
+ if (token) {
+ access(token);
+ }
+ // eslint-disable-next-line
+ }, [])
+
return { state, actions };
}
diff --git a/net/web/src/session/conversation/useConversation.hook.js b/net/web/src/session/conversation/useConversation.hook.js
index ff1608b4..a8783b8f 100644
--- a/net/web/src/session/conversation/useConversation.hook.js
+++ b/net/web/src/session/conversation/useConversation.hook.js
@@ -134,21 +134,24 @@ export function useConversation(cardId, channelId) {
}, [state.contentKey]);
const clickableText = (text) => {
- var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
+ const urlPattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
+ const hostPattern = new RegExp('^https?:\\/\\/', 'i');
+
let group = '';
let clickable = [];
const words = text == null ? '' : DOMPurify.sanitize(text).split(' ');
words.forEach((word, index) => {
- if (!!pattern.test(word)) {
+ if (!!urlPattern.test(word)) {
clickable.push({ group });
group = '';
- clickable.push({ `${word} ` });
+ const url = !!hostPattern.test(word) ? word : `https://${word}`;
+ clickable.push({ `${word} ` });
}
else {
group += `${word} `;