Created
August 25, 2011 23:20
-
-
Save Raynos/1172297 to your computer and use it in GitHub Desktop.
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
//server | |
of('/room/:id/details') | |
emit('roomUpdated', { | |
details: { | |
} | |
}, delay); | |
//client | |
connect("/room/:id/details") | |
emit("changeRoom", { | |
details: { | |
} | |
}) |
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
//server | |
of('/room/:id/flags') | |
emit('messageFlagged', { | |
messageId: | |
totalFlags: | |
}); | |
//client | |
connect("url/room/:id/flags") | |
emit("flagMessage", { | |
messageId | |
}) |
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
// server | |
of('/room/:id/messages') | |
emit("newMessage", { | |
userId: // user Id of message poster | |
text: // text content of message | |
messageId: // id of message | |
}); | |
emit("messageChanged", { | |
messageId: | |
text: | |
}); | |
emit("provide:recentMessages", { | |
messages: [ | |
// message objects | |
] | |
}); | |
emit("provide:messageDetails", { | |
messageId: | |
details: { | |
} | |
}) | |
// client | |
connect('url/room/:id/messages') | |
emit("sendMessage", { | |
userId: // my id | |
text: // my message | |
}); | |
emit("editMessage", { | |
messageId: // message id | |
text: // new text | |
}) | |
emit("spamError"); | |
emit("request:recentMessages", messageCount, messageId); | |
emit("request:messageDetails", messageId) |
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
//server | |
of("/system/") | |
emit("systemMessage": { | |
type: | |
message: | |
details: { | |
} | |
}) |
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
// server | |
of('/room/:id/stars') | |
emit("messageStarred", { | |
messageId: // message being starred | |
totalStars: // total stars for message | |
}); | |
emit("provide:recentStars", { | |
[ | |
// star objects | |
] | |
}) | |
// client | |
connect('url/room/:id/stars') | |
emit("starMessage", { | |
userId: // my user id | |
messageId: // message I'm starring | |
}); | |
emit("request:recentStars", starAmount, messageId) |
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
// server | |
of('/room/:id/users') | |
emit("userJoined", { | |
userId: // id of users | |
data: { | |
// user data client neds | |
} | |
}); | |
emit("userLeft", { | |
userId: // | |
}); | |
emit("provide:usersInRoom", { | |
users: [ | |
// user objects | |
] | |
}) | |
//client | |
connect("url/room/:id/users") | |
emit("request:usersInRoom") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment