From c11da4dd7e082fd54562c3676dc27f4a0e8e3048 Mon Sep 17 00:00:00 2001 From: theia Date: Fri, 3 Feb 2023 17:07:17 -0500 Subject: Private messaging working --- demo/components/moderation.js | 4 +++ demo/components/private-messaging.js | 66 ++++++++++++++++++++++++++++++++++++ demo/index.html | 7 ++-- graffiti.js | 3 +- 4 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 demo/components/private-messaging.js diff --git a/demo/components/moderation.js b/demo/components/moderation.js index 1a2b0fd..4cf8071 100644 --- a/demo/components/moderation.js +++ b/demo/components/moderation.js @@ -22,6 +22,8 @@ export default { +

Example 1

+

Only show me objects with more than likes.

@@ -35,6 +37,8 @@ export default {
+

Example 2

+

Only show me objects that + + + + +

+ + +
+ + + +

My Outbox

+ + + +

My Inbox

+ + + +
` +} diff --git a/demo/index.html b/demo/index.html index 57b3132..1f05b25 100644 --- a/demo/index.html +++ b/demo/index.html @@ -17,6 +17,7 @@ import { Name, SetMyName } from './components/name.js' import Chat from './components/chat.js' import Moderation from './components/moderation.js' + import PrivateMessaging from './components/private-messaging.js' import GraffitiVue from 'graffiti-vue' createApp() .use(GraffitiVue) @@ -24,6 +25,7 @@ .component('SetMyName', SetMyName) .component('Chat', Chat) .component('Moderation', Moderation) + .component('PrivateMessaging', PrivateMessaging) .mount('#app') @@ -65,9 +67,8 @@ -

Private Messages

+

Private Messaging

-

Tagging

- + diff --git a/graffiti.js b/graffiti.js index 4100e08..824fdf6 100644 --- a/graffiti.js +++ b/graffiti.js @@ -140,7 +140,7 @@ export default class { // Replace the object by copying // so references to it don't break this.#recursiveCopy(objectMap[uuid], object) - } else { + } else if (!('_id' in object)) { // Add properties to the object // so it can be updated and removed @@ -148,6 +148,7 @@ export default class { Object.defineProperty(object, '_id', { value: this.#objectUUID(object) }) Object.defineProperty(object, '_update', { value: ()=>this.update(object) }) Object.defineProperty(object, '_remove', { value: ()=>this.remove(object) }) + objectMap[uuid] = object } } -- cgit v1.2.3-70-g09d2