This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var streamLib = require('activity-streams-mongoose')({ | |
| mongoUrl: app.siteConf.mongoUrl, | |
| redis: app.siteConf.redisOptions, | |
| defaultActor: defaultAvatar | |
| }); | |
| var authentication = new require('./authentication.js')(streamLib, app.siteConf); | |
| // Moved normalization to only be done on pre save | |
| streamLib.types.UserSchema.pre('save', function (next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var redis = require("redis"); | |
| var publisher = redis.createClient(options.redis.port, options.redis.host); | |
| if(options.redis.pass) { | |
| publisher.auth(options.redis.pass); | |
| } | |
| function publish(streamName, activity) { | |
| activity.save(function(err) { | |
| if (!_.isArray(activity.streams)) { | |
| activity.streams = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/ciberch/activity-streams-mongoose | |
| Activity.find().sort('published', 'descending').limit(10).run( | |
| function (err, docs) { | |
| var activities = []; | |
| if (!err && docs) { | |
| activities = docs; | |
| res.render('index', {activities: activities}); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| User.hasMany("bugs", Bug, "creatorId"); | |
| Bug.belongsTo("user", User, "creatorId"); | |
| Project.hasMany("bugs", Bug, "projectId"); | |
| Bug.belongsTo("project", Project, "projectId"); | |
| User.hasMany("commits", Commit, "creatorId"); | |
| Commit.belongsTo("user", User, "creatorId"); | |
| Project.hasMany("commits", Commit, "projectId"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"items": [ | |
| { | |
| "verb": "post", // Id which maps to specification submitted to activity streams registrar | |
| "postedTime": "2010-12-12T12:12:12Z", | |
| "title": "Plain Text", | |
| "summary": "Plain Text", // Have not decided on plain text only | |
| "permalinkUrl": "...", | |
| "to": [{"id" : "acct:john.doe@example.org"}], // We should use person constructs here | |
| "cc": [{"id":"acct:jane.doe@example.org"}], | |
| "bcc": [{"id":"acct:jean.deux@example.org"}], |
NewerOlder