Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

33
LINES

< > BotCompany Repo | #1020515 // dm_moduleLibraryComments_mergeFromRemote

JavaX fragment (include)

1  
svoid dm_moduleLibraryComments_mergeFromRemote(S computerID) {
2  
  L lRemote = dm_remote_callModule_safeRestruct(computerID,
3  
    dm_remote_requireModule(computerID, "#1019617/ModuleLibraryComments"),
4  
    'concepts);
5  
  print("Got " + n2(lRemote, "remote entry", "remote entries"));
6  
  O module = dm_requireModule("#1019617/ModuleLibraryComments");
7  
  for (O o : lRemote) {
8  
    S snippetID = getString(o, 'snippetID);
9  
    if (empty(snippetID)) continue;
10  
    
11  
    S rComment = getString(o, 'comment);
12  
    if (nempty(rComment)) {
13  
      S comment = dm_call(module, 'getComment, snippetID);
14  
      if (nempty(comment) && neq(rComment, comment))
15  
        print("Conflict for snippet ID: " + snippetID);
16  
      else if (empty(comment)) {
17  
        dm_call(module, 'setComment, snippetID, rComment);
18  
        print("Set comment for " + snippetID);
19  
      }
20  
    }
21  
    
22  
    S rForPublic = getString(o, 'forPublic);
23  
    if (nempty(rForPublic)) {
24  
      S forPublic = dm_call(module, 'getForPublic, snippetID);
25  
      if (nempty(forPublic) && neq(rForPublic, forPublic))
26  
        print("Conflict for snippet ID: " + snippetID);
27  
      else if (empty(forPublic)) {
28  
        dm_call(module, 'setForPublic, snippetID, rForPublic);
29  
        print("Set for-public value for " + snippetID);
30  
      }
31  
    }
32  
  }
33  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020515
Snippet name: dm_moduleLibraryComments_mergeFromRemote
Eternal ID of this version: #1020515/2
Text MD5: 50771e5c4d27b1d6ab8316c6916aa21b
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-25 17:41:13
Source code size: 1306 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 244 / 257
Version history: 1 change(s)
Referenced in: [show references]