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

49
LINES

< > BotCompany Repo | #1012201 // ai_postTriple_verbose

JavaX fragment (include)

1  
please include function ai_postTriple.
2  
3  
static S ai_postTriple_verbose(T3<S> triple) {
4  
  // check, clean
5  
  
6  
  print("ai_postTriple: " + sfu(triple));
7  
  
8  
  ping();
9  
  if (triple_anyPartNull(triple)) null;
10  
  triple = trimTriple(triple);
11  
  if (!ai_tripleAllowedToPost(triple)) {
12  
    print("ai_postTriple: not allowed");
13  
    null; // fail("No");
14  
  }
15  
  
16  
  // existing?
17  
18  
  if (has(triple)) {
19  
    print("ai_postTriple: exists");
20  
    null;
21  
  }
22  
  
23  
  // invalid?
24  
  
25  
  if (has(ai_tripleToInvalid(triple))) {
26  
    print("ai_postTriple: invalid");
27  
    null;
28  
  }
29  
  
30  
  // post handler?
31  
  
32  
  print("ai_postTriple: posting");
33  
  AI_PostHandler handler = ai_postHandler();
34  
  if (handler != null)
35  
    ret handler.postTriple(triple);
36  
  else {
37  
    // post web the normal way
38  
    Web web = webFromTriple(triple);
39  
    Bool ver = ai_postTriple_verified!;
40  
    if (ver != null)
41  
      web.unverified = !ver;
42  
    postSoftwareMadeWeb(web);
43  
    ret web.globalID();
44  
  }
45  
}
46  
47  
static S ai_postTriple_verbose(S a, S b, S c) {
48  
  ret ai_postTriple_verbose(t3(a, b, c));
49  
}

Author comment

Began life as a copy of #1011399

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012201
Snippet name: ai_postTriple_verbose
Eternal ID of this version: #1012201/3
Text MD5: 0ac9b291a44a3001380945110490a811
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-26 20:45:29
Source code size: 1078 bytes / 49 lines
Pitched / IR pitched: No / No
Views / Downloads: 417 / 431
Version history: 2 change(s)
Referenced in: [show references]