chat-linker icon indicating copy to clipboard operation
chat-linker copied to clipboard

support multiple rooms between telegram and xmpp

Open albjeremias opened this issue 5 years ago • 6 comments

albjeremias avatar Aug 16 '18 15:08 albjeremias

Wow, really interesting stuff. Are you done yet? Should I review?

ForNeVeR avatar Aug 19 '18 03:08 ForNeVeR

yeah, its done... :) i have been testing it for the last few days... please feel free to comment on how the config should look like... this version will break the current config...

albjeremias avatar Aug 19 '18 15:08 albjeremias

@ForNeVeR i cannot find any place where i can assigne it back to u...

albjeremias avatar Aug 21 '18 15:08 albjeremias

Sorry? I've assigned it to myself and I'll review/merge when I'll be able to.

ForNeVeR avatar Aug 21 '18 15:08 ForNeVeR

Wonderful code editing, thanks!

I had thoughts about the configuration scheme for connecting multiple chats here #3 (maybe outdated) I assumed that we would someday want to connect for example two xmpp-conferences of one network, Or for example 4 chat rooms at the same time [slack_hardcode, xmpp_coders, xmpp_python, telegram_coders]

so I think that the config should look something like this:

{
   // bots configs
  bots: { slack_1, xmpp_bot1,  xmpp_bot2,  tg_bot1,  tg_bot2},
  rooms: {
    // room configs
    slack_hardcode: {}, 
    xmpp_python: {},
    xmpp_coders: {},
    tg_coders: {},
    tg_js: {},
    xmpp_js: {},
  },
  links: [
    // customizing the links between bots and rooms
    ['xmpp_js', 'tg_js', slack_1], // linked chats
    ['xmpp_python', 'xmpp_coders', 'tg_coders'], // another linked chats
/* or maybe:
    [
          'xmpp_bot1@xmpp_python',
          'xmpp_bot2@xmpp_coders',
          'tg_bot2@tg_coders'
    ],
*/
  ],
}

any ideas on this ? (perhaps not in this pull-request)

jt3k avatar Aug 27 '18 23:08 jt3k

hmm I'd rather go for something more simple... like:

{
  "rooms":
  {
      "dev": [
      {
        "xmpp": ["[email protected]", "[email protected]"]
        "telegramId": -310606513
      },
      {
        "xmpp": "[email protected]",
        "telegramId": [-1001161009393, -162979832132]
      }
      ],
      "prod": []
  },

and on the code we could detect if it is an array... then we do what we need to do... but that complicates a lot the bridging.. and may create funky bugs... i'd rather duplicate the configurations something like:

  "rooms":
  {
      "dev": [
      {
        "xmpp": "[email protected]"
        "telegramId": -310606513
      },
      {
        "xmpp": "[email protected]"
        "telegramId": -310606513
      },
      {
        "xmpp": "[email protected]",
        "telegramId": -1001161009393
      }
      {
        "xmpp": "[email protected]",
        "telegramId": -162979832132
      }
      ],
      "prod": []
  },

the bigger problem... is that this new way of config will make previous configs unusable... that worries me more...

albjeremias avatar Aug 28 '18 07:08 albjeremias