-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtempRefact.js
More file actions
25 lines (25 loc) · 1.18 KB
/
tempRefact.js
File metadata and controls
25 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var findContentNode = function(messageObject) {
if (messageObject.payload.hasOwnProperty("parts")){
if (messageObject.payload.parts[1]){
isGmailContent = true;
return messageObject.payload.parts[0].body.data;
}
else if (messageObject.payload.parts[0]){
if (messageObject.payload.parts[0].parts){
debugger
// Debugger placed as the logic for this case is likely not be complete
// Need to check if the node below does in fact contain the data, if not add a case
return messageObject.payload.parts[0].parts[1].body.data;
}
else {
debugger
// Debugger placed as the logic for this case is likely not be complete
// Need to check if the node below does in fact contain the data, if not add a case
return messageObject.payload.parts[0].body.data;
}
}
}
else if (messageObject.payload.body) {
return messageObject.payload.body.data
}
}