Skip to content

Commit e84b8d6

Browse files
Peter XiePeter Xie
authored andcommitted
fix outlook mail bug
1 parent b08d488 commit e84b8d6

File tree

6 files changed

+80
-88
lines changed

6 files changed

+80
-88
lines changed

app/public/scripts/home.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,12 +3449,6 @@ var view_layout;
34493449
this.QTGateConnecting(4);
34503450
let text = this.conformText();
34513451
// Outlook Mail
3452-
if (u.indexOf('-----BEGIN PGP MESSAGE----- Version: GnuPG v1 ') > -1) {
3453-
text = text.replace(/-----BEGIN PGP MESSAGE----- Version: GnuPG v1 /, '-----BEGIN__PGP__MESSAGE-----\r\nVersion:__GnuPG__v1\r\n\r\n');
3454-
text = text.replace(/-----END PGP MESSAGE-----/, '-----END__PGP__MESSAGE-----');
3455-
text = text.replace(/ /g, '\r\n');
3456-
text = text.replace(/__/g, ' ');
3457-
}
34583452
return socketIo.emit('checkActiveEmailSubmit', text);
34593453
}
34603454
connectQTGate() {

app/public/scripts/home.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3794,12 +3794,7 @@ module view_layout {
37943794
this.QTGateConnecting ( 4 )
37953795
let text = this.conformText ()
37963796
// Outlook Mail
3797-
if ( u.indexOf ('-----BEGIN PGP MESSAGE----- Version: GnuPG v1 ') > -1 ) {
3798-
text = text.replace (/-----BEGIN PGP MESSAGE----- Version: GnuPG v1 /,'-----BEGIN__PGP__MESSAGE-----\r\nVersion:__GnuPG__v1\r\n\r\n')
3799-
text = text.replace (/-----END PGP MESSAGE-----/, '-----END__PGP__MESSAGE-----')
3800-
text = text.replace (/ /g, '\r\n')
3801-
text = text.replace ( /__/g, ' ')
3802-
}
3797+
38033798
return socketIo.emit ( 'checkActiveEmailSubmit', text )
38043799

38053800
}

app/server.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -660,17 +660,22 @@ class localServer {
660660
remote.app.exit();
661661
});
662662
socket.on('checkActiveEmailSubmit', (text) => {
663-
console.log(`checkActiveEmailSubmit!`);
664-
/*
665-
if ( ! text || ! text.length || !/^-----BEGIN PGP MESSAGE-----/.test ( text )) {
666-
socket.emit ( 'checkActiveEmailError', 0 )
667-
return saveLog ( `checkActiveEmailSubmit, no text.length !` )
663+
console.log(`checkActiveEmailSubmit!`, text);
664+
if (!text || !text.length || !/^-----BEGIN PGP MESSAGE-----/.test(text)) {
665+
socket.emit('checkActiveEmailError', 0);
666+
return saveLog(`checkActiveEmailSubmit, no text.length !`);
668667
}
669-
*/
670668
if (!this.QTClass) {
671669
socket.emit('checkActiveEmailError', 2);
672670
return saveLog(`checkActiveEmailSubmit, have no this.QTClass!`);
673671
}
672+
if (text.indexOf('-----BEGIN PGP MESSAGE----- Version: GnuPG v1 ') > -1) {
673+
console.log(`Outlook mail! support!`);
674+
text = text.replace(/-----BEGIN PGP MESSAGE----- Version: GnuPG v1 /, '-----BEGIN__PGP__MESSAGE-----\r\nVersion:__GnuPG__v1\r\n\r\n');
675+
text = text.replace(/-----END PGP MESSAGE-----/, '-----END__PGP__MESSAGE-----');
676+
text = text.replace(/ /g, '\r\n');
677+
text = text.replace(/__/g, ' ');
678+
}
674679
this.pgpDecrypt(text, (err, data) => {
675680
if (err) {
676681
socket.emit('checkActiveEmailError', 1);
@@ -1671,7 +1676,7 @@ const makeFeedBackDataToQTGateAPIRequestCommand = (data, Callback) => {
16711676
if (err) {
16721677
return Callback(err, null);
16731678
}
1674-
data.attachImage = iData.toString('base64');
1679+
//data.attachImage = iData.toString ('base64')
16751680
ret.Args = [data];
16761681
Fs.unlink(data.attachImagePath, () => {
16771682
return Callback(null, ret);

app/server.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,18 +708,27 @@ export class localServer {
708708
})
709709

710710
socket.on ( 'checkActiveEmailSubmit', ( text: string ) => {
711-
console.log (`checkActiveEmailSubmit!`)
712-
/*
711+
console.log (`checkActiveEmailSubmit!`, text )
712+
713713
if ( ! text || ! text.length || !/^-----BEGIN PGP MESSAGE-----/.test ( text )) {
714714
socket.emit ( 'checkActiveEmailError', 0 )
715715
return saveLog ( `checkActiveEmailSubmit, no text.length !` )
716716
}
717-
*/
717+
718718
if ( ! this.QTClass ) {
719719
socket.emit ( 'checkActiveEmailError', 2 )
720720
return saveLog ( `checkActiveEmailSubmit, have no this.QTClass!` )
721721
}
722722

723+
if ( text.indexOf ('-----BEGIN PGP MESSAGE----- Version: GnuPG v1 ') > -1 ) {
724+
console.log (`Outlook mail! support!`)
725+
text = text.replace (/-----BEGIN PGP MESSAGE----- Version: GnuPG v1 /,'-----BEGIN__PGP__MESSAGE-----\r\nVersion:__GnuPG__v1\r\n\r\n')
726+
text = text.replace (/-----END PGP MESSAGE-----/, '-----END__PGP__MESSAGE-----')
727+
text = text.replace (/ /g, '\r\n')
728+
text = text.replace ( /__/g, ' ')
729+
}
730+
731+
723732
this.pgpDecrypt ( text, ( err, data ) => {
724733
if ( err ) {
725734
socket.emit ( 'checkActiveEmailError', 1 )
@@ -1949,7 +1958,7 @@ const makeFeedBackDataToQTGateAPIRequestCommand = ( data: feedBackData, Callback
19491958
if ( err ) {
19501959
return Callback ( err, null )
19511960
}
1952-
data.attachImage = iData.toString ('base64')
1961+
//data.attachImage = iData.toString ('base64')
19531962
ret.Args = [data]
19541963
Fs.unlink ( data.attachImagePath, () => {
19551964
return Callback ( null, ret )

package-lock.json

Lines changed: 52 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qtgate",
3-
"version": "0.8.80",
3+
"version": "0.8.81",
44
"license": "MIT",
55
"description": "QTGate desktop client",
66
"scripts": {
@@ -53,7 +53,7 @@
5353
},
5454
"homepage": "https://www.qtgate.com",
5555
"devDependencies": {
56-
"electron-builder-squirrel-windows": "^19.43.0"
56+
"electron-builder-squirrel-windows": "^19.45.0"
5757
},
5858
"dependencies": {
5959
"async": "^2.5.0",

0 commit comments

Comments
 (0)