Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5_fork
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5_fork
Commits
2b5b0939
Commit
2b5b0939
authored
Mar 17, 2016
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_jabber_client: fix messages loss, thx
@cedric.leninivin
parent
b2f63f39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
7 deletions
+60
-7
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
.../PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
+58
-5
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
...PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
+2
-2
No files found.
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.js
View file @
2b5b0939
...
...
@@ -43,6 +43,30 @@
return
gadget
.
state_parameter_dict
.
my_jid
+
'
-
'
+
jid
;
}
function
enqueueDefer
(
gadget
,
callback
)
{
var
deferred
=
gadget
.
props
.
current_deferred
;
// Unblock queue
if
(
deferred
!==
undefined
)
{
deferred
.
resolve
(
"
Another event added
"
);
}
// Add next callback
try
{
gadget
.
props
.
service_queue
.
push
(
callback
);
}
catch
(
error
)
{
throw
new
Error
(
"
Connection gadget already crashed...
"
+
gadget
.
props
.
service_queue
.
rejectedReason
.
toString
());
}
// Block the queue
deferred
=
RSVP
.
defer
();
gadget
.
props
.
current_deferred
=
deferred
;
gadget
.
props
.
service_queue
.
push
(
function
()
{
return
deferred
.
promise
;
});
}
function
getLog
(
gadget
,
jid
,
options
)
{
return
wrapJioCall
(
gadget
,
'
getAttachment
'
,
[
getStorageIdFromJid
(
gadget
,
jid
),
'
enclosure
'
,
options
])
.
push
(
undefined
,
function
(
error
)
{
...
...
@@ -55,11 +79,21 @@
}
function
addLog
(
gadget
,
jid
,
text
,
is_incoming
)
{
return
getLog
(
gadget
,
jid
,
{
format
:
'
text
'
})
.
push
(
function
(
result
)
{
var
new_history
=
result
+
getLogString
(
text
,
is_incoming
);
return
wrapJioCall
(
gadget
,
'
putAttachment
'
,
[
getStorageIdFromJid
(
gadget
,
jid
),
'
enclosure
'
,
new_history
]);
});
var
deferred
=
RSVP
.
defer
();
enqueueDefer
(
gadget
,
function
()
{
return
getLog
(
gadget
,
jid
,
{
format
:
'
text
'
})
.
push
(
function
(
result
)
{
var
new_history
=
result
+
getLogString
(
text
,
is_incoming
);
return
wrapJioCall
(
gadget
,
'
putAttachment
'
,
[
getStorageIdFromJid
(
gadget
,
jid
),
'
enclosure
'
,
new_history
]);
})
.
push
(
function
()
{
deferred
.
resolve
();
return
true
;
});
});
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
deferred
.
promise
;
});
}
function
dropConnectionGadget
(
gadget
)
{
...
...
@@ -160,6 +194,9 @@
}
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
})
.
allowPublicAcquisition
(
"
notifyXMPPConnecting
"
,
function
()
{
return
;
...
...
@@ -431,6 +468,22 @@
throw
new
Error
(
'
Unsupported putAttachment:
'
+
id
+
'
'
+
name
);
})
.
declareService
(
function
()
{
// queue for addLog
var
context
=
this
;
context
.
props
.
service_queue
=
new
RSVP
.
Queue
();
enqueueDefer
(
context
);
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
context
.
props
.
service_queue
;
})
.
push
(
function
()
{
throw
new
Error
(
"
Service should not have been stopped!
"
);
});
})
.
declareService
(
function
()
{
return
loopEventListener
(
window
,
...
...
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jio_js.xml
View file @
2b5b0939
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
949.
36462.22852.4232
</string>
</value>
<value>
<string>
949.
57481.62457.42496
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
145
7082886.14
</float>
<float>
145
8172700.61
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment