Uses 911K of libraries. Click here for Pure Java version (14961L/80K).
1 | !7 |
2 | |
3 | sS chatBotID = #1026221; |
4 | |
5 | cmodule MultiComm > DynMultiComm {
|
6 | void blablu {}
|
7 | |
8 | start {
|
9 | dm_vmBus_onMessage_q chatBot_userPolling(voidfunc(O mc, virtual Conversation conv) {
|
10 | Customer c = customerFromConv(mc, conv); |
11 | if (c == null) ret; |
12 | }); |
13 | |
14 | dm_vmBus_onMessage_q chatBot_messageAdded(voidfunc(O mc, virtual Conversation conv, virtual Msg msg) {
|
15 | Customer c = customerFromConv(mc, conv); |
16 | if (c == null) ret; |
17 | S text = getString text(msg); |
18 | bool fromUser = getBool fromUser(msg); |
19 | if (fromUser) |
20 | cnew(IncomingMessage, customer := c, +text, unread := true); |
21 | else |
22 | cnew(OutgoingMessage, customer := c, +text); |
23 | }); |
24 | |
25 | dm_registerAs_direct iptvMultiComm(); |
26 | } |
27 | |
28 | Customer customerFromConv(O mc, virtual Conversation conv) {
|
29 | S cookie = getString cookie(conv); |
30 | if (empty(cookie)) null; |
31 | Customer c = uniq(Customer, +cookie); |
32 | cset(c, ip := getString ip(conv)); |
33 | cset(c, lastPing := now(), botConversationID := |
34 | BotConversationID(programID(mc), getLong id(conv)); |
35 | ret c; |
36 | } |
37 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1026276 |
| Snippet name: | IPTV Multi-Comm Server Module |
| Eternal ID of this version: | #1026276/44 |
| Text MD5: | b9690c5f9216501b72d6c56415b029b4 |
| Transpilation MD5: | 77a33aea88d15f9250dbc3362b427677 |
| Author: | stefan |
| Category: | javax / comm |
| Type: | JavaX source code (Dynamic Module) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-12-12 00:33:54 |
| Source code size: | 1121 bytes / 37 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 534 / 1232 |
| Version history: | 43 change(s) |
| Referenced in: | [show references] |