Fixed YatQa rror
This commit is contained in:
		
							parent
							
								
									c7f989da8b
								
							
						
					
					
						commit
						f7924d29df
					
				@ -486,11 +486,13 @@ command_result QueryClient::handleCommandChannelList(Command& cmd) {
 | 
				
			|||||||
    command_builder result{"", 1024, entries.size()};
 | 
					    command_builder result{"", 1024, entries.size()};
 | 
				
			||||||
    for(const auto& channel : entries){
 | 
					    for(const auto& channel : entries){
 | 
				
			||||||
        if(!channel) continue;
 | 
					        if(!channel) continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const auto channel_clients = this->server ? this->server->getClientsByChannel(channel).size() : 0;
 | 
				
			||||||
        result.put_unchecked(index, "cid", channel->channelId());
 | 
					        result.put_unchecked(index, "cid", channel->channelId());
 | 
				
			||||||
        result.put_unchecked(index, "pid", channel->properties()[property::CHANNEL_PID].as<string>());
 | 
					        result.put_unchecked(index, "pid", channel->properties()[property::CHANNEL_PID].as<string>());
 | 
				
			||||||
        result.put_unchecked(index, "channel_name", channel->name());
 | 
					        result.put_unchecked(index, "channel_name", channel->name());
 | 
				
			||||||
        result.put_unchecked(index, "channel_order", channel->channelOrder());
 | 
					        result.put_unchecked(index, "channel_order", channel->channelOrder());
 | 
				
			||||||
        result.put_unchecked(index, "total_clients", this->server ? this->server->getClientsByChannel(channel).size() : 0);
 | 
					        result.put_unchecked(index, "total_clients", channel_clients);
 | 
				
			||||||
        /* result.put_unchecked(index, "channel_needed_subscribe_power", channel->permissions()->getPermissionValue(permission::i_channel_needed_subscribe_power, channel, 0)); */
 | 
					        /* result.put_unchecked(index, "channel_needed_subscribe_power", channel->permissions()->getPermissionValue(permission::i_channel_needed_subscribe_power, channel, 0)); */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if(cmd.hasParm("flags")){
 | 
					        if(cmd.hasParm("flags")){
 | 
				
			||||||
@ -522,8 +524,8 @@ command_result QueryClient::handleCommandChannelList(Command& cmd) {
 | 
				
			|||||||
        if(cmd.hasParm("topic")) {
 | 
					        if(cmd.hasParm("topic")) {
 | 
				
			||||||
            result.put_unchecked(index, "channel_topic", channel->properties()[property::CHANNEL_TOPIC].as<string>());
 | 
					            result.put_unchecked(index, "channel_topic", channel->properties()[property::CHANNEL_TOPIC].as<string>());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if(cmd.hasParm("times")){
 | 
					        if(cmd.hasParm("times") || cmd.hasParm("secondsempty")){
 | 
				
			||||||
            result.put_unchecked(index, "seconds_empty", channel->emptySince());
 | 
					            result.put_unchecked(index, "seconds_empty", channel_clients == 0 ? channel->emptySince() : 0);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        index++;
 | 
					        index++;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,7 @@ namespace ts {
 | 
				
			|||||||
                virtual ~SqlDataManager();
 | 
					                virtual ~SqlDataManager();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                [[nodiscard]] inline int get_database_version() const { return this->_database_version; }
 | 
					                [[nodiscard]] inline int get_database_version() const { return this->_database_version; }
 | 
				
			||||||
                [[nodiscard]] inline int get_permissions_version() const { return this->_database_version; }
 | 
					                [[nodiscard]] inline int get_permissions_version() const { return this->_permissions_version; }
 | 
				
			||||||
                bool initialize(std::string&);
 | 
					                bool initialize(std::string&);
 | 
				
			||||||
                void finalize();
 | 
					                void finalize();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user