jt3k / chat-linker

the bridge between jabber and telegram over chat-bots
MIT License
47 stars 9 forks source link

support multiple rooms between telegram and xmpp #68

Open albjeremias opened 6 years ago

ForNeVeR commented 6 years ago

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

albjeremias commented 6 years ago

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 commented 6 years ago

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

ForNeVeR commented 6 years ago

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

jt3k commented 6 years ago

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)

albjeremias commented 6 years ago

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

{
  "rooms":
  {
      "dev": [
      {
        "xmpp": ["bimo_test@conference.jabber.ru", "otherroom@conference.com"]
        "telegramId": -310606513
      },
      {
        "xmpp": "javascript@conference.jabber.ru",
        "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": "otherroom@conference.com"
        "telegramId": -310606513
      },
      {
        "xmpp": "otherroom@conference.com"
        "telegramId": -310606513
      },
      {
        "xmpp": "javascript@conference.jabber.ru",
        "telegramId": -1001161009393
      }
      {
        "xmpp": "javascript@conference.jabber.ru",
        "telegramId": -162979832132
      }
      ],
      "prod": []
  },

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