Changeset 381
- Timestamp:
- 09/29/11 18:11:47 (13 years ago)
- Location:
- server/trunk/web/lib/Sophie/Controller
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
server/trunk/web/lib/Sophie/Controller/Chat/Cmd.pm
r379 r381 174 174 =head2 set [distribution|release|arch] value 175 175 176 Set default search value 176 Set default search value (see also: unset) 177 177 178 178 =cut … … 185 185 return $c->stash->{xmlrpc} = { 186 186 private_reply => 1, 187 message => [ "$var set to: " . ($val || '(none)') ], 187 message => [ 188 "$var set to: " . ($val || '(none)'), 189 ($c->forward('/distrib/exists', [ 190 $c->forward('/user/fetchdata', [ $reqspec->{from}, ]) ]) 191 ? () 192 : ("warning: your setting does not match any distribution") 193 ), 194 ] 195 }; 196 } 197 198 =head2 unset [distribution|release|arch] 199 200 Unset default search value (see also: set) 201 202 =cut 203 204 sub unset : XMLRPC { 205 my ( $self, $c, $reqspec, $var ) = @_; 206 207 $c->forward('/user/update_data', [ $reqspec->{from}, { $var => undef } ]); 208 209 return $c->stash->{xmlrpc} = { 210 private_reply => 1, 211 message => [ "$var set to: (none)" ], 188 212 }; 189 213 } … … 213 237 }; 214 238 } else { 215 warn my $own = $c->forward('_fmt_question', [$res]); 216 warn my $applied = $c->forward('_fmt_question', [$reqspec]); 239 my $own = $c->forward('_fmt_question', [$res]); 240 my $applied = $c->forward('_fmt_question', [$reqspec]); 241 217 242 return $c->stash->{xmlrpc} = { 218 243 message => [ sprintf('your setting is: %s%s', … … 222 247 : '' 223 248 ) 224 ) ], 249 ), 250 ($c->forward('/distrib/exists', [ $res ]) 251 ? () 252 : ("warning: your setting does not match any distribution") 253 ) 254 ], 225 255 } 226 256 } -
server/trunk/web/lib/Sophie/Controller/User.pm
r289 r381 111 111 112 112 foreach (keys %$data) { 113 $prev_data->{$_} = $data->{$_}; 113 if (defined($data->{$_})) { 114 $prev_data->{$_} = $data->{$_}; 115 } else { 116 delete($prev_data->{$_}); 117 } 114 118 } 115 119
Note: See TracChangeset
for help on using the changeset viewer.