Code Monkey home page Code Monkey logo

Comments (1)

dkovik avatar dkovik commented on May 19, 2024 4

Hi Infactum,
I have commented 2 lines in the process_event function inside the gateway.cpp and the DTMF started to work again.

The DTMF numbers are received, via Telegram chat.

However I still do not know if my changes do not have some unwanted side effect as I really do not understand the code.

void Gateway::process_event(td::td_api::object_ptr<td::td_api::updateNewMessage> update_message) {
      auto &sender = update_message->message_->sender_id_;
      //if (sender->get_id() == td_api::messageSenderUser::ID)
      //    return;
      auto user = static_cast<const td_api::messageSenderUser *>(sender.get());
  
      std::vector<Bridge *> matches;
      for (auto bridge : bridges) {
          if (bridge->ctx->user_id == user->user_id_) {
              matches.emplace_back(bridge);
          }   
      }   
  
      if (matches.size() > 1) {
          logger_->error("ambiguous message from {}", user->user_id_);
          return;
      } else if (matches.size() == 1) {
          TRACE(logger_, "routing message to ctx {}", matches[0]->ctx->id());
          matches[0]->sm->process_event(update_message);
      }   
  
  }

I have commented (removed)

if (sender->get_id() == td_api::messageSenderUser::ID)
    return;

So the functions

matches[0]->sm->process_event(update_message);

gets called and the DTMF starts to work again.

from tg2sip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.