Changeset 109

Show
Ignore:
Timestamp:
21/10/08 14:02:30 (3 months ago)
Author:
smoku
Message:

Improvements in user session handling.
Load only user files (with @ in filename).
Do not probe users that not requested to.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • jggtrans/src/users.c

    r80 r109  
    307307 
    308308        uin=ujid=name=password=email=NULL; 
     309        if(!strchr(jid,'@')) return NULL; 
    309310        debug(L_("Loading user '%s'"),jid); 
    310311        fn=jid_normalized(jid,0); 
     
    459460Contact *c; 
    460461 
    461         g_message(L_("Destroying user '%s'"),u->jid); 
     462        debug(L_("Destroying user '%s'"),u->jid); 
    462463 
    463464        g_assert(u!=NULL); 
     
    614615DIR *dir; 
    615616Stream *s; 
     617User *u; 
    616618struct dirent *de; 
    617619struct stat st; 
     
    631633                        continue; 
    632634                } 
    633                 if (S_ISREG(st.st_mode) && strchr(de->d_name,'@'))  
    634                         presence_send_probe(s,NULL,de->d_name); 
     635                if (S_ISREG(st.st_mode) && strchr(de->d_name,'@')){ 
     636                        u=user_get_by_jid(de->d_name); 
     637                        if(u && (u->subscribe==SUB_FROM || u->subscribe==SUB_BOTH)) 
     638                                presence_send_probe(s,NULL,de->d_name); 
     639                        user_free(u); 
     640                } 
    635641        } 
    636642        closedir(dir);