-
Notifications
You must be signed in to change notification settings - Fork 3
/
peek0.rho
31 lines (29 loc) · 1.14 KB
/
peek0.rho
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#define $return *stdout
new lockerCh, itemsCh, $stdout, $lookup in {
lookup!($locker_%%$myusername, *lockerCh) | for(locker <- lockerCh) {
locker!("get", $myprivkey.hexToBytes(), $locker_nonce_%%$myusername, *stdout, *itemsCh) |
for (@items <- itemsCh) {
if ( items.get("peek") == Nil ) {
stdout!("you do not have a peek channel for your inbox")
} else {
@{items.get("peek")}!($return)
/* @{items.get("peek")}!($type, $subtype, *$return) */
} |
stdout!(["#define $locker_nonce_" ++ $myusername, {$locker_nonce_%%$myusername + 1}])
} } }
/*
```scala
define: $peek($types_return...)
new lockerCh, itemsCh, $stdout, $lookup in {
lookup!($locker_%%$myusername, *lockerCh) | for(locker <- lockerCh) {
locker!("get", $myprivkey.hexToBytes(), $locker_nonce_%%$myusername, *stdout, *itemsCh) |
for (@items <- itemsCh) {
if ( items.get("peek") == Nil ) {
stdout!("you do not have a peek channel for your inbox")
} else {
@{items.get("peek")}!($types_return)
} |
stdout!(["#define $locker_nonce_" ++ $myusername, {$locker_nonce_%%$myusername + 1}])
} } }
```
*/