diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-23 18:47:40 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-03-23 18:47:40 +0000 |
commit | 500efd6f234f5cb0d84d2396bd0eab6f70a35e10 (patch) | |
tree | fdd0b41ab999859c0eaf1870ded2a11c95e9702c /plugins/IEView/src/TemplateHTMLBuilder.cpp | |
parent | b098799c15568ac46d96739682adb2fc24231b08 (diff) |
finaly ieview should work with noavatar in formats png and jpg
git-svn-id: http://svn.miranda-ng.org/main/trunk@4168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/TemplateHTMLBuilder.cpp')
-rw-r--r-- | plugins/IEView/src/TemplateHTMLBuilder.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index f7ffa2f1bd..522a104221 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -201,13 +201,18 @@ void TemplateHTMLBuilder::buildHeadTemplate(IEView *view, IEVIEWEVENT *event, Pr szNameOut = mir_strdup(" ");
szNameIn = mir_strdup(" ");
}
- sprintf(tempStr, "%snoavatar.png", tempBase);
- szNoAvatar = mir_utf8encode(tempStr);
- if (access(szNoAvatar, 0) == -1)
- {
+ mir_snprintf(tempStr, SIZEOF(tempStr), "%snoavatar.png", tempBase);
+ TCHAR szNoAvatarPath[MAX_PATH];
+ mir_sntprintf(szNoAvatarPath, SIZEOF(szNoAvatarPath), _T("%s"), _A2T(protoSettings->getSRMMTemplateFilename()));
+ TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ if (szNoAvatarPathTmp != NULL)
+ *szNoAvatarPathTmp = 0;
+ _tcscat(szNoAvatarPath, _T("\\noavatar.png"));
+ if (_taccess(szNoAvatarPath, 0) == -1)
sprintf(tempStr, "%snoavatar.jpg", tempBase);
- szNoAvatar = mir_utf8encode(tempStr);
- }
+ else
+ sprintf(tempStr, "%snoavatar.png", tempBase);
+ szNoAvatar = mir_utf8encode(tempStr);
szAvatarIn = getAvatar(event->hContact, szRealProto);
if (szAvatarIn == NULL) {
szAvatarIn = mir_strdup(szNoAvatar);
@@ -377,14 +382,17 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, szNameOut = mir_strdup(" ");
szNameIn = mir_strdup(" ");
}
- sprintf(tempStr, "%snoavatar.png", tempBase);
- szNoAvatar = mir_utf8encode(tempStr);
- if (access(szNoAvatar, 0) == -1)
- {
+ TCHAR szNoAvatarPath[MAX_PATH];
+ mir_sntprintf(szNoAvatarPath, SIZEOF(szNoAvatarPath), _T("%s"), _A2T(protoSettings->getSRMMTemplateFilename()));
+ TCHAR *szNoAvatarPathTmp = _tcsrchr(szNoAvatarPath, '\\');
+ if (szNoAvatarPathTmp != NULL)
+ *szNoAvatarPathTmp = 0;
+ _tcscat(szNoAvatarPath, _T("\\noavatar.png"));
+ if (_taccess(szNoAvatarPath, 0) == -1)
sprintf(tempStr, "%snoavatar.jpg", tempBase);
- szNoAvatar = mir_utf8encode(tempStr);
- }
-
+ else
+ sprintf(tempStr, "%snoavatar.png", tempBase);
+ szNoAvatar = mir_utf8encode(tempStr);
if(event->hContact != NULL) {
szAvatarIn = getAvatar(event->hContact, szRealProto);
}
|