diff --git a/src/lib/messaging.js b/src/lib/messaging.js
index ecaba6e4..b887dcd3 100644
--- a/src/lib/messaging.js
+++ b/src/lib/messaging.js
@@ -2,7 +2,7 @@ import crypto from 'react-native-crypto';
import { getChash160, isValidAddress } from 'obyte/lib/utils';
import { getSignedMessageInfoFromJsonBase64 } from './oCustom';
-export const REG_WALLET_ADDRESS = /^([A-Z0-9]{32})$/g;
+export const REG_WALLET_ADDRESS = /(.*?\s|^)([2-7A-Z]{32})([\s.,;!:].*?|$)/g;
export const REG_REQUEST_PAYMENT = /\[.*?\]\(((?:byteball-tn|byteball|obyte-tn|obyte):([0-9A-Z]{32})(?:\?([\w=&;+%]+))?)\)/g;
export const REGEX_SIGN_MESSAGE_REQUEST = /\[(.+?)\]\(sign-message-request(-network-aware)?:(.+?)\)/g;
export const REGEX_SIGNED_MESSAGE = /\[(.+?)\]\(signed-message:([\w\/+=]+?)\)/g;
@@ -61,21 +61,18 @@ export const parseTextMessage = originalText => {
type = 'PROSAIC_CONTRACT';
return toDelayedReplacement({ type, text: '[UNSUPPORTED ACTION]' });
})
- .replace(REG_WALLET_ADDRESS, (str, address) => {
+ .replace(REG_WALLET_ADDRESS, (str, description, address) => {
type = 'WALLET_ADDRESS';
- params = { address };
- return toDelayedReplacement({ type, address });
+ return toDelayedReplacement({ type, description, address });
})
.replace(REG_REQUEST_PAYMENT, (str, payload, address, amount) => {
type = 'REQUEST_PAYMENT';
- params = { amount, address };
return toDelayedReplacement({ type, address, amount });
})
.replace(
REGEX_SIGN_MESSAGE_REQUEST,
(str, description, networkAware, messageToSign) => {
type = 'SIGN_MESSAGE_REQUEST';
- params = { messageToSign };
return toDelayedReplacement({ type, messageToSign });
},
)
diff --git a/src/screens/ChatScreen/index.js b/src/screens/ChatScreen/index.js
index d0be9e89..fe6f0dc6 100644
--- a/src/screens/ChatScreen/index.js
+++ b/src/screens/ChatScreen/index.js
@@ -84,14 +84,15 @@ const ChatScreen = ({
)
}
case "WALLET_ADDRESS": {
- const { address } = data;
+ const { address, description } = data;
return user._id !== 1
? (
navigation.navigate('MakePayment', { walletAddress: data.address })}>
+ {description ? {description} : null}
{address}
)
- : {address}
+ : {description ? `${description}${address}` : address}
}
case "REQUEST_PAYMENT": {
const { amount, address } = data;
@@ -135,7 +136,7 @@ const ChatScreen = ({
: {`Request to sign message: \"${messageToSign}\"`}
}
case "SIGNED_MESSAGE": {
- return {`Signed message: ${data.text}`}
+ return {`Signed message: ${data.text}`}
}
case "URL": {
const { url } = data;