Merge pull request #13 from deltachat/support-info-and-summary
adapt to the new specs of webxdc.sendUpdate()master
commit
18f3be41da
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
function sendMsg() {
|
function sendMsg() {
|
||||||
msg = document.getElementById("input").value;
|
msg = document.getElementById("input").value;
|
||||||
window.webxdc.sendUpdate({"name": window.webxdc.selfName(), "msg": msg}, 'someone typed "'+msg+'"');
|
window.webxdc.sendUpdate({payload: {name: window.webxdc.selfName(), msg: msg}}, 'someone typed "'+msg+'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
function receiveUpdate(update) {
|
function receiveUpdate(update) {
|
||||||
|
|
|
@ -27,9 +27,9 @@ window.webxdc = (() => {
|
||||||
var updatesJSON = window.localStorage.getItem(updatesKey);
|
var updatesJSON = window.localStorage.getItem(updatesKey);
|
||||||
return updatesJSON ? JSON.parse(updatesJSON) : [];
|
return updatesJSON ? JSON.parse(updatesJSON) : [];
|
||||||
},
|
},
|
||||||
sendUpdate: (payload, description) => {
|
sendUpdate: (update, description) => {
|
||||||
// alert(description+"\n\n"+JSON.stringify(payload));
|
// alert(description+"\n\n"+JSON.stringify(payload));
|
||||||
var update = {payload: payload};
|
update = {payload: update.payload, summary: update.summary, info: update.info}
|
||||||
console.log('[Webxdc] description="' + description + '", ' + JSON.stringify(update));
|
console.log('[Webxdc] description="' + description + '", ' + JSON.stringify(update));
|
||||||
updateListener(update);
|
updateListener(update);
|
||||||
var updatesJSON = window.localStorage.getItem(updatesKey);
|
var updatesJSON = window.localStorage.getItem(updatesKey);
|
||||||
|
|
Loading…
Reference in New Issue