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

37
LINES

< > BotCompany Repo | #1026276 // IPTV Multi-Comm Server Module

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (14961L/80K).

!7

sS chatBotID = #1026221;

cmodule MultiComm > DynMultiComm {
  void blablu {}
  
  start {
    dm_vmBus_onMessage_q chatBot_userPolling(voidfunc(O mc, virtual Conversation conv) {
      Customer c = customerFromConv(mc, conv);
      if (c == null) ret;
    });
    
    dm_vmBus_onMessage_q chatBot_messageAdded(voidfunc(O mc, virtual Conversation conv, virtual Msg msg) {
      Customer c = customerFromConv(mc, conv);
      if (c == null) ret;
      S text = getString text(msg);
      bool fromUser = getBool fromUser(msg);
      if (fromUser)
        cnew(IncomingMessage, customer := c, +text, unread := true);
      else
        cnew(OutgoingMessage, customer := c, +text);
    });
    
    dm_registerAs_direct iptvMultiComm();
  }
  
  Customer customerFromConv(O mc, virtual Conversation conv) {
    S cookie = getString cookie(conv);
    if (empty(cookie)) null;
    Customer c = uniq(Customer, +cookie);
    cset(c, ip := getString ip(conv));
    cset(c, lastPing := now(), botConversationID := 
      BotConversationID(programID(mc), getLong id(conv));
    ret c;
  }
}

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: 307 / 960
Version history: 43 change(s)
Referenced in: #1026288 - DynMultiComm