Skip to content

Commit

Permalink
Zowe Suite v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zowe-robot authored Nov 8, 2019
2 parents 54f9dd2 + 0fed13b commit c96b4f1
Show file tree
Hide file tree
Showing 35 changed files with 3,628 additions and 9,887 deletions.
1 change: 1 addition & 0 deletions bootstrap/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
dist/*
dts/*
web/*
!web/iframe-adapter.js
node_modules/*
src/uri/*.js
src/uri/*.js.map
Expand Down
17 changes: 14 additions & 3 deletions bootstrap/lib/notificationProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ exports.adminNotificationWebsocketRouter = function(context) {
const EVERYONE = "Everyone"
const INDIVIDUAL = "Individual"


return new Promise(function(resolve, reject) {
let router = express.Router();
if (!router.ws) {
Expand All @@ -38,10 +37,16 @@ exports.adminNotificationWebsocketRouter = function(context) {
if (req.body.recipient === INDIVIDUAL) {
let index = client_names.indexOf(req.body.username.toUpperCase())
if (index != -1) {
let sent = false;
clients[index].forEach(function(instance) {
instance.send(JSON.stringify({'from': req.username, 'notification': req.body.notification, "to": req.body.recipient}))
sent = true;
})
res.status(201).json({"Response" : "Message sent to " + req.body.recipient});
if (sent) {
res.status(201).json({"Response" : "Message sent to " + req.body.recipient});
} else {
res.status(500).json({"Response" : "Server error"});
}
} else {
if (req.body.username === "") {
res.status(404).json({"Response" : "Recipient input cannot be blank"});
Expand All @@ -50,12 +55,18 @@ exports.adminNotificationWebsocketRouter = function(context) {
}
}
} else if (req.body.recipient === EVERYONE){
let sent = false;
clients.forEach(function(client) {
client.forEach(function(instance) {
sent = true;
instance.send(JSON.stringify({'from': req.username, 'notification': req.body.notification, "to": req.body.recipient}))
})
})
res.status(201).json({"Response" : "Message sent to Everyone"});
if (sent) {
res.status(201).json({"Response" : "Message sent to " + req.body.recipient});
} else {
res.status(500).json({"Response" : "Server error"});
}
} else {
res.status(400).json({"Response": "Message was not sent"})
}
Expand Down
Loading

0 comments on commit c96b4f1

Please sign in to comment.