Skip to content

Commit

Permalink
Allow activity events to have body text.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentonv committed Sep 19, 2016
1 parent a888d9f commit e5d9b19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/node/handler/SandstormHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var ACTIVITY_TYPES = {
"reply": 2,
};

exports.activity = function (sessionId, type, path, threadPath, threadTitle) {
exports.activity = function (sessionId, type, path, threadPath, threadTitle, body) {
if (type == "edit") {
// Only post edits once every 15 seconds per active session.
var last = lastActivityTime[sessionId] || 0;
Expand All @@ -49,6 +49,11 @@ exports.activity = function (sessionId, type, path, threadPath, threadTitle) {
title: { defaultText: threadTitle || threadPath },
};
}
if (body) {
activity.notification = {
caption: { defaultText: body }
};
}

return httpBridge.getSessionContext(sessionId).context.activity(activity);
}).catch(err => {
Expand Down

0 comments on commit e5d9b19

Please sign in to comment.