diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-11 10:41:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-11 10:41:37 +0000 |
commit | 94dcc72f13094157f344f284aec4edf0c0f5faa1 (patch) | |
tree | 74c078daadd4abe5aea9e9e0a73b4dd7c4a7fde1 /protocols/IcqOscarJ/src/icqosc_svcs.cpp | |
parent | 42ff2169dbddd25d06404623dba2fff222d17c73 (diff) |
ProtoGetAvatarFormat, ProtoGetAvatarFileFormat, ProtoGetBufferFormat, ProtoGetAvatarExtension - standard helpers for protocol avatars' processing instead of the zoo that existed previously
git-svn-id: http://svn.miranda-ng.org/main/trunk@5645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src/icqosc_svcs.cpp')
-rw-r--r-- | protocols/IcqOscarJ/src/icqosc_svcs.cpp | 58 |
1 files changed, 23 insertions, 35 deletions
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 8bd8195462..ff04d94b85 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -333,49 +333,37 @@ INT_PTR CIcqProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) if (wParam == AF_MAXSIZE)
{
POINT *size = (POINT*)lParam;
-
- if (size)
- {
+ if (size) {
size->x = 64;
size->y = 64;
-
- return 0;
}
+ return 0;
}
- else if (wParam == AF_PROPORTION)
- {
+
+ if (wParam == AF_PROPORTION)
return PIP_NONE;
- }
- else if (wParam == AF_FORMATSUPPORTED)
- {
- if (lParam == PA_FORMAT_JPEG || lParam == PA_FORMAT_GIF || lParam == PA_FORMAT_XML || lParam == PA_FORMAT_BMP)
- return 1;
- else
- return 0;
- }
- else if (wParam == AF_ENABLED)
- {
- if (m_bSsiEnabled && m_bAvatarsEnabled)
- return 1;
- else
- return 0;
- }
- else if (wParam == AF_DONTNEEDDELAYS)
- {
+
+ if (wParam == AF_FORMATSUPPORTED)
+ return (lParam == PA_FORMAT_JPEG || lParam == PA_FORMAT_GIF || lParam == PA_FORMAT_XML || lParam == PA_FORMAT_BMP);
+
+ if (wParam == AF_ENABLED)
+ return (m_bSsiEnabled && m_bAvatarsEnabled);
+
+ if (wParam == AF_DONTNEEDDELAYS)
return 0;
- }
- else if (wParam == AF_MAXFILESIZE)
- { // server accepts images of 7168 bytees, not bigger
+
+ // server accepts images of 7168 bytees, not bigger
+ if (wParam == AF_MAXFILESIZE)
return 7168;
- }
- else if (wParam == AF_DELAYAFTERFAIL)
- { // do not request avatar again if server gave an error
+
+ // do not request avatar again if server gave an error
+ if (wParam == AF_DELAYAFTERFAIL)
return 1 * 60 * 60 * 1000; // one hour
- }
- else if (wParam == AF_FETCHALWAYS)
- { // avatars can be fetched all the time (server only operation)
+
+ // avatars can be fetched all the time (server only operation)
+ if (wParam == AF_FETCHALWAYS)
return 1;
- }
+
return 0;
}
@@ -561,7 +549,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) if (tszFile)
{ // set file for avatar
- int dwPaFormat = DetectAvatarFormat(tszFile);
+ int dwPaFormat = ::ProtoGetAvatarFileFormat(tszFile);
if (dwPaFormat != PA_FORMAT_XML)
{
// if it should be image, check if it is valid
|