diff --git a/Posts DB.xmind b/Posts DB.xmind deleted file mode 100644 index c56cf271..00000000 Binary files a/Posts DB.xmind and /dev/null differ diff --git a/PostsSystem.drawio b/PostsSystem.drawio new file mode 100644 index 00000000..fcde3ee4 --- /dev/null +++ b/PostsSystem.drawio @@ -0,0 +1 @@ +7V1dl5o4GP41ntO9mB4+BJ3LGTttz9nt2W7t6baXETLCisQDsTP212+iRCBRxBF4Q8e5aCUmSB6e9zNvYGBPls8fErQKPhEfRwPL8J8H9ruBxf5GFvuPt2x2LWNztGuYJ6G/azLzhmn4C2eNRta6Dn2cljpSQiIarsqNHolj7NFSG0oS8lTu9kii8q+u0BwrDVMPRWrrv6FPg2wWjpG3f8ThPBC/bBrZN0skOmcNaYB88lRosh8G9iQhhO4+LZ8nOOLgCVx2494f+XZ/YQmOaZ0Bvz4u/vnmIuTd/Nisv0cBQXRyY+/O8hNF62zC2cXSjUAA+wyQ7JAkNCBzEqPoIW+9T8g69jH/GYMd5X3+ImTFGk3W+B+mdJPdXbSmhDUFdBll36pTyWaXknXi4YrrF5RAyRzTin7ZtPhcCj+QAfUBkyWmyYZ1SHCEaPizfPNRxqH5vl8OM/uQIX0G6s4rQX2oFeqmgvpnktJ0ukkpXio3IIeXY/UUhBRPV2gLyxNTdTWh/IkTip8rJ599aws9kSnKYXb4lGsdU3QJChrHNVqCa9Rzklo1SepqRdLxFXUA1G+vqEMoZAMCZQZusvnOx791xOGP7HTbg3fPpaNNdtT+3THNpm9PNvQzCdk1HzU11liyIbsrzUZJN3l/GS+/75YibffIW+DYV+hwwuyWbXQDRtiSkDHBrbC4AGDVlDJK0DseT7GGmMRYtL0P+XwycfFFDy9CaRp6u8asy2UablhThuzbVmSITQxtCh1WXDbS4yLmGhKRRlJwdqL/rSExZ3cBjYrh0Owxk3ItXtLhuUpvXIvXZeCw8VjzCGVkXTXqVosP7St92qBP40FzPfqwgPOtUfgza5Gpa71oOV0oRsXkvk9ITHVwUIbaOSimHinE7r16t6ZAm+3Yg3M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TF+WIind9/ghEpali3To0MH/Wt7Mq6kTQsuns9GRHXyR1LWTHxpfBcAlvc+OJ+rhERFMOsZzNMeRQPvue5ryGeppK81PK/kVa3GVTbtFsnrO0iwNFUgqnDzT6fyJKcFvtoG7NS9o24fjnJMBmivFro732wtYkFTeUogAwJq8l2rUdqR4sF2z5iIAgoj9Lh7KkFq/QnrtyC4k+cW/FpGeUfGqlERPxj6BiykpUgAXcFwFyKwSm27Tov1jd1F3TmzKTmbam6VpyIjMbxg+XPjQ3x31Ba/qALuocMVx2NiC8wcntaJN7bluEs6ntBZNbFJvvypbRR/N5Xu/9Hw== \ No newline at end of file diff --git a/PostsSystemInteraction.deprecated.drawio b/PostsSystemInteraction.deprecated.drawio deleted file mode 100644 index a3e3dd3f..00000000 --- a/PostsSystemInteraction.deprecated.drawio +++ /dev/null @@ -1,149 +0,0 @@ -7Vxbb6w2EP41SO1DImwwl8fsrVV1qraKqp7ziHY5u7RkSQm59dfXLLYZD2ZhNyykOZUiBMY29nj8zTfj2VjO/O7lhzy63/2cbeLUovbmxXIWFqXEpdQq/+zNqygJvKAq2ebJRpTVBbfJP7EotEXpY7KJH7SKRZalRXKvF66z/T5eF1pZlOfZs17ta5bqX72PtnGj4HYdpc3SP5JNsatKA2bX5T/GyXYnv0xs8eYukpVFwcMu2mTPoMhZWs48z7Kiurt7mcdpKT0pl6rdquWtGlge74s+DdyfAve3v++S1f3Pn35//CXIQv/2SvTyFKWPYsIW9VLe32yTPPHbbXlrLWzrZlVeZ661IFZgH+6Xsir/JqxdzbZ4lSLMs8f9Ji5HYfPXz7ukiG/vo3X59plrDS/bFXcpfyKq9VOcF/FL60SJEh9XvDi7i4v8lVcRDWggJC50jrri+RksoCjagbWT1SKhMlvVcy1VfiMEe4KQaVPIpUQP11kly/BwnR+uTMgYy5F/iWt9PIoMXSzDoClD3yBD51IydAyKiuWz39yUO54/rdPo4SFZ62LhU89fP8OHL6VOXjP5uHgROlo9vcqnl6T4DO5BK/5UNyofZJtqcP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diff --git a/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/repos/TriggersToPostsRepo.kt b/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/repos/TriggersToPostsRepo.kt index 0486655f..132eb1b3 100644 --- a/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/repos/TriggersToPostsRepo.kt +++ b/publishing/api/src/commonMain/kotlin/dev/inmo/postssystem/core/publishing/repos/TriggersToPostsRepo.kt @@ -11,13 +11,19 @@ interface TriggersToPostsRepo : KeyValueRepo, WriteTriggersTo fun TriggersToPostsRepo( keyValueRepo: KeyValueRepo, generator: PostKeyGenerator, + publishingKeyReceiverGetter: PublishingKeyReceiverGetter, writePublishingKeysRegistrar: WritePublishingRegistrar ): TriggersToPostsRepo = object : TriggersToPostsRepo, KeyValueRepo by keyValueRepo { override suspend fun set(toSet: Map) { keyValueRepo.set( toSet.filter { (postId, triggerId) -> + val publishingKeyReceiver = publishingKeyReceiverGetter(triggerId) ?: return@filter false val publishingKey = generator(postId, triggerId) - writePublishingKeysRegistrar.registerTriggerForPost(publishingKey, postId) + writePublishingKeysRegistrar.registerTriggerForPost(publishingKey, postId).also { + if (it) { + publishingKeyReceiver.acceptKey(postId, publishingKey) + } + } } ) }