@ -5794,29 +5794,30 @@ function rcube_webmail()
if ( id === null || ! this . env . contacts [ id ] || ! this . ksearch _input )
return ;
var trigger = false , insert = '' , delim = ', ' ;
var trigger = false , insert = '' , delim = ', ' ,
contact = this . env . contacts [ id ] ;
this . ksearch _destroy ( ) ;
// insert all members of a group
if ( typeof this . env . contact s[ id ] === 'object' && this . env . contact s[ id ] . type == 'group' && ! this . env . contacts [ id ] . email ) {
insert + = this . env . contact s[ id ] . name + delim ;
this . group2expand [ this . env . contact s[ id ] . id ] = $ . extend ( { input : this . ksearch _input } , this . env . contact s[ id ] ) ;
this . http _request ( 'mail/group-expand' , { _source : this . env . contact s[ id ] . source , _gid : this . env . contact s[ id ] . id } , false ) ;
if ( typeof contact === 'object' && contact . type == 'group' && ! contact . email && contact . id ) {
insert = contact . name + delim ;
this . group2expand [ contact . id ] = $ . extend ( { input : this . ksearch _input } , contact ) ;
this . http _request ( 'mail/group-expand' , { _source : contact . source , _gid : contact . id } , false ) ;
}
else if ( typeof this . env . contact s[ id ] === 'object' && this . env . contact s[ id ] . name ) {
insert = this . env . contact s[ id ] . name + delim ;
else if ( typeof contact === 'object' && contact . name ) {
insert = contact . name + delim ;
trigger = true ;
}
else if ( typeof this . env . contact s[ id ] === 'string' ) {
insert = this . env . contact s[ id ] + delim ;
else if ( typeof contact === 'string' ) {
insert = contact + delim ;
trigger = true ;
}
this . ksearch _input _replace ( this . ksearch _value , insert ) ;
if ( trigger ) {
this . triggerEvent ( 'autocomplete_insert' , { field : this . ksearch _input , insert : insert , data : this . env . contacts [ id ] , search : this . ksearch _value _last , result _type : 'person' } ) ;
this . triggerEvent ( 'autocomplete_insert' , { field : this . ksearch _input , insert : insert , data : contact , search : this . ksearch _value _last , result _type : 'person' } ) ;
this . ksearch _value _last = null ;
this . compose _type _activity ++ ;
}