mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-10-31 06:37:35 +01:00 
			
		
		
		
	Do not override pre-existing registry with default values
This commit is contained in:
		
							parent
							
								
									0d70d85506
								
							
						
					
					
						commit
						b4e8302f32
					
				| @ -74,6 +74,10 @@ sub add { | ||||
|   $section = lc $section; | ||||
|   $item = lc $item; | ||||
| 
 | ||||
|   if ($is_default) { | ||||
|     return if exists $self->{registry}->hash->{$section} and exists $self->{registry}->hash->{$section}->{$item}; | ||||
|   } | ||||
| 
 | ||||
|   $self->{registry}->hash->{$section}->{$item}->{value} = $value; | ||||
|   $self->{registry}->hash->{$section}->{$item}->{type}  = $type; | ||||
| 
 | ||||
| @ -108,6 +112,12 @@ sub set { | ||||
|   $item = lc $item; | ||||
|   $key = lc $key if defined $key; | ||||
| 
 | ||||
|   if ($is_default) { | ||||
|     return if exists $self->{registry}->hash->{$section} | ||||
|       and exists $self->{registry}->hash->{$section}->{$item} | ||||
|       and exists $self->{registry}->hash->{$section}->{$item}->{$key}; | ||||
|   } | ||||
| 
 | ||||
|   my $oldvalue = $self->get_value($section, $item, 1) if defined $value; | ||||
|   $oldvalue = '' if not defined $oldvalue; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pragmatic Software
						Pragmatic Software