Skip to content

Commit 74a6a56

Browse files
committed
ignore invalid messages
1 parent 5cff2f7 commit 74a6a56

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

angular-chat.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ angular.module('chat').service( 'Messages', [ 'ChatCore', function(ChatCore) {
6666
Messages.receive = function(fn) {
6767
function receiver(response) {
6868
response.data.m.forEach(function(msg){
69+
// Ignore messages without User Data
70+
// TODO
71+
if (!(msg.d && msg.u && msg.u.id)) return;
6972
fn({
7073
data : msg.d
7174
, id : msg.p.t

0 commit comments

Comments
 (0)