Ticket #3771: 3771_quickly_uglyWIP.patch

File 3771_quickly_uglyWIP.patch, 1.9 KB (added by Imarok, 7 years ago)

A very ugly approach to fix it

  • source/lobby/XmppClient.cpp

     
    114114    m_client->registerMessageHandler(this);
    115115
    116116    // Uncomment to see the raw stanzas
    117     //m_client->getWrapped()->logInstance().registerLogHandler( gloox::LogLevelDebug, gloox::LogAreaAll, this );
     117    m_client->getWrapped()->logInstance().registerLogHandler( gloox::LogLevelDebug, gloox::LogAreaAll, this );
    118118
    119119    if (!regOpt)
    120120    {
     
    175175 */
    176176void XmppClient::handleLog(gloox::LogLevel level, gloox::LogArea area, const std::string& message)
    177177{
    178     std::cout << "log: level: " << level << ", area: " << area << ", message: " << message << std::endl;
     178    //LOGERROR(/*"log: level: %s, area: %s, */"message: %s"/*, level, area*/, message);
     179    if (message.find("Users are not allowed to register accounts so quickly") != std::string::npos)
     180    {
     181        CreateGUIMessage("system", "error", "Users are not allowed to register accounts so quickly");
     182        //LOGERROR("found");
     183    }
    179184}
    180185
    181186/*****************************************************
  • source/lobby/XmppClient.h

     
    3333    struct CertInfo;
    3434}
    3535
    36 class XmppClient : public IXmppClient, public glooxwrapper::ConnectionListener, public glooxwrapper::MUCRoomHandler, public glooxwrapper::IqHandler, public glooxwrapper::RegistrationHandler, public glooxwrapper::MessageHandler
     36class XmppClient : public IXmppClient, public glooxwrapper::ConnectionListener, public glooxwrapper::MUCRoomHandler, public glooxwrapper::IqHandler, public glooxwrapper::RegistrationHandler, public glooxwrapper::MessageHandler, public gloox::LogHandler
    3737{
    3838    NONCOPYABLE(XmppClient);
    3939