Added avatar manager which will help when transfering and caching avatars. Using boost::filesystem. MD5 sum is used to identify avatars, different types of files are possible. Avatar cache (and the avatars provided) use for example <md5sum>.png as file names, so that no additional storage for the md5sum is required.
A cache directory with write permissions is required, however, as avatars are not cached in RAM.
This commit is contained in:
@@ -89,11 +89,16 @@ MD5Buf::FromString(const std::string &text)
|
||||
}
|
||||
|
||||
bool
|
||||
MD5Buf::operator==(const MD5Buf &other)
|
||||
MD5Buf::operator==(const MD5Buf &other) const
|
||||
{
|
||||
return memcmp(data, other.data, MD5_DATA_SIZE) == 0;
|
||||
}
|
||||
|
||||
bool
|
||||
MD5Buf::operator<(const MD5Buf &other) const
|
||||
{
|
||||
return memcmp(data, other.data, MD5_DATA_SIZE) < 0;
|
||||
}
|
||||
|
||||
bool
|
||||
CryptHelper::MD5Sum(const std::string &fileName, MD5Buf &buf)
|
||||
|
||||
Reference in New Issue
Block a user