social_stream-presence 0.13.2 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -69,6 +69,7 @@ PRESENCE.XMPPClient = (function(P,$,undefined){
|
|
69
69
|
this.affiliation = "none";
|
70
70
|
this.role = "none";
|
71
71
|
this.nick = getBaseNickFromUserName();
|
72
|
+
this.lastMessageId = null;
|
72
73
|
}
|
73
74
|
|
74
75
|
|
@@ -360,7 +361,6 @@ PRESENCE.XMPPClient = (function(P,$,undefined){
|
|
360
361
|
|
361
362
|
//Chat messages handler
|
362
363
|
var onMessage = function(msg) {
|
363
|
-
|
364
364
|
var from = msg.getAttribute('from');
|
365
365
|
var type = msg.getAttribute('type');
|
366
366
|
var elems = msg.getElementsByTagName('body');
|
@@ -895,17 +895,27 @@ PRESENCE.XMPPClient = (function(P,$,undefined){
|
|
895
895
|
///////
|
896
896
|
|
897
897
|
//MUC Messages
|
898
|
-
var onRoomMessage = function(
|
898
|
+
var onRoomMessage = function(roomMsg) {
|
899
|
+
|
899
900
|
//from=roomSlug@conference.domain/from_slug
|
900
|
-
var from =
|
901
|
-
var type =
|
902
|
-
var elems =
|
901
|
+
var from = roomMsg.getAttribute('from');
|
902
|
+
var type = roomMsg.getAttribute('type');
|
903
|
+
var elems = roomMsg.getElementsByTagName('body');
|
903
904
|
|
904
905
|
if (type == "groupchat" && elems.length > 0) {
|
905
906
|
var body = elems[0];
|
906
907
|
var user_nick = getNickFromChatRoomJid(from)
|
907
908
|
var msg = Strophe.getText(body);
|
908
|
-
|
909
|
+
|
910
|
+
//Prevent repeated messages
|
911
|
+
var roomSlug = getSlugFromJid(from);
|
912
|
+
var id = roomMsg.getAttribute('id');
|
913
|
+
if((roomSlug in roomsInfo)&&(roomsInfo[roomSlug].lastMessageId != null)&&(roomsInfo[roomSlug].lastMessageId == id)){
|
914
|
+
return true;
|
915
|
+
}
|
916
|
+
roomsInfo[roomSlug].lastMessageId = id;
|
917
|
+
|
918
|
+
PRESENCE.UIMANAGER.afterReceivedGroupChatMessage(from,msg)
|
909
919
|
}
|
910
920
|
return true;
|
911
921
|
}
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-presence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 13
|
8
|
+
- 3
|
9
|
+
version: 0.13.3
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Aldo Gordillo
|
@@ -10,7 +14,8 @@ autorequire:
|
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2012-05-16 00:00:00
|
17
|
+
date: 2012-05-16 00:00:00 +02:00
|
18
|
+
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: social_stream-base
|
@@ -20,6 +25,10 @@ dependencies:
|
|
20
25
|
requirements:
|
21
26
|
- - ~>
|
22
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 20
|
31
|
+
- 1
|
23
32
|
version: 0.20.1
|
24
33
|
type: :runtime
|
25
34
|
version_requirements: *id001
|
@@ -31,6 +40,8 @@ dependencies:
|
|
31
40
|
requirements:
|
32
41
|
- - ">="
|
33
42
|
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 0
|
34
45
|
version: "0"
|
35
46
|
type: :runtime
|
36
47
|
version_requirements: *id002
|
@@ -42,6 +53,8 @@ dependencies:
|
|
42
53
|
requirements:
|
43
54
|
- - ">="
|
44
55
|
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 0
|
45
58
|
version: "0"
|
46
59
|
type: :runtime
|
47
60
|
version_requirements: *id003
|
@@ -53,6 +66,8 @@ dependencies:
|
|
53
66
|
requirements:
|
54
67
|
- - ">="
|
55
68
|
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
56
71
|
version: "0"
|
57
72
|
type: :runtime
|
58
73
|
version_requirements: *id004
|
@@ -64,6 +79,8 @@ dependencies:
|
|
64
79
|
requirements:
|
65
80
|
- - ">="
|
66
81
|
- !ruby/object:Gem::Version
|
82
|
+
segments:
|
83
|
+
- 0
|
67
84
|
version: "0"
|
68
85
|
type: :development
|
69
86
|
version_requirements: *id005
|
@@ -272,6 +289,7 @@ files:
|
|
272
289
|
- vendor/assets/javascripts/strophe.muc.js
|
273
290
|
- vendor/assets/stylesheets/flexselect.css
|
274
291
|
- vendor/assets/stylesheets/jquery.ui.chatbox.css
|
292
|
+
has_rdoc: true
|
275
293
|
homepage: https://github.com/ging/social_stream/wiki/Getting-Started-With-Social-Stream-Presence
|
276
294
|
licenses: []
|
277
295
|
|
@@ -285,17 +303,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
285
303
|
requirements:
|
286
304
|
- - ">="
|
287
305
|
- !ruby/object:Gem::Version
|
306
|
+
segments:
|
307
|
+
- 0
|
288
308
|
version: "0"
|
289
309
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
310
|
none: false
|
291
311
|
requirements:
|
292
312
|
- - ">="
|
293
313
|
- !ruby/object:Gem::Version
|
314
|
+
segments:
|
315
|
+
- 0
|
294
316
|
version: "0"
|
295
317
|
requirements: []
|
296
318
|
|
297
319
|
rubyforge_project: social_stream-presence
|
298
|
-
rubygems_version: 1.
|
320
|
+
rubygems_version: 1.3.7
|
299
321
|
signing_key:
|
300
322
|
specification_version: 3
|
301
323
|
summary: Presence capabilities for Social Stream, the core for building social network websites.
|