diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-10-02 16:30:03 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-10-02 16:30:03 +0000 |
commit | 64cfd8d4bd3a5d0da31eab8df5356f697f3d1dc4 (patch) | |
tree | 8508395d7388e6fa63160535dffb9b6d6d7a48dd /plugins | |
parent | 76403b8fa94edb904ddf9a6b5426b193062e08bf (diff) |
IEView: flash avatars removed; other fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15490 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/IEView/src/MUCCHTMLBuilder.cpp | 2 | ||||
-rw-r--r-- | plugins/IEView/src/ScriverHTMLBuilder.cpp | 4 | ||||
-rw-r--r-- | plugins/IEView/src/TemplateHTMLBuilder.cpp | 47 | ||||
-rw-r--r-- | plugins/IEView/src/TemplateHTMLBuilder.h | 3 |
4 files changed, 9 insertions, 47 deletions
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp index b232f3d5e1..9fd96db78d 100644 --- a/plugins/IEView/src/MUCCHTMLBuilder.cpp +++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp @@ -247,7 +247,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event) }
str.AppendFormat("<div class=\"%s\">", divName);
if (dwData & IEEDD_MUCC_SHOW_TIME || dwData & IEEDD_MUCC_SHOW_DATE)
- str.AppendFormat("<span class=\"%s\">%s </span>", isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time));
+ str.AppendFormat("<span class=\"%s\">%s </span>", "timestamp", timestampToString(dwData, eventData->time));
str.AppendFormat("<span class=\"%s\">", className);
str.AppendFormat(Translate(eventText), szText);
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp index 566bdf8e51..afaab42afb 100644 --- a/plugins/IEView/src/ScriverHTMLBuilder.cpp +++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp @@ -310,9 +310,9 @@ void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event }
else {
if (eventData->iType == IEED_EVENT_MESSAGE)
- className = isRTL ? isSent ? "divOutRTL" : "divInRTL" : isSent ? "divOut" : "divIn";
+ className = isRTL ? (isSent ? "divOutRTL" : "divInRTL") : (isSent ? "divOut" : "divIn");
else
- className = isRTL ? isSent ? "divNoticeRTL" : "divNoticeRTL" : isSent ? "divNotice" : "divNotice";
+ className = isRTL ? "divNoticeRTL" : (isSent ? "divNotice" : "divNotice");
}
CMStringA str;
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index b8f692cf18..896e55fbb2 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -27,17 +27,10 @@ TemplateHTMLBuilder::TemplateHTMLBuilder() startedTime = time(NULL);
lastEventTime = time(NULL);
groupTemplate = NULL;
- flashAvatarsTime[0] = time(NULL);
- flashAvatarsTime[1] = time(NULL);
- flashAvatars[0] = NULL;
- flashAvatars[1] = NULL;
}
TemplateHTMLBuilder::~TemplateHTMLBuilder()
{
- for (int i = 0; i < 2; i++)
- if (flashAvatars[i] != NULL)
- mir_free(flashAvatars[i]);
}
char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
@@ -63,17 +56,12 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
if (mir_tstrlen(dbv.ptszVal) > 0) {
TCHAR *ext = _tcsrchr(dbv.ptszVal, '.');
- if (ext && mir_tstrcmpi(ext, _T(".xml")) == 0)
- result = (TCHAR*)getFlashAvatar(dbv.ptszVal, (hContact == NULL) ? 1 : 0);
- else {
- if (result == NULL) {
- /* relative -> absolute */
- mir_tstrcpy(tmpPath, dbv.ptszVal);
- if (_tcsncmp(tmpPath, _T("http://"), 7))
- PathToAbsoluteT(dbv.ptszVal, tmpPath);
-
- result = tmpPath;
- }
+ if (result == NULL) {
+ /* relative -> absolute */
+ mir_tstrcpy(tmpPath, dbv.ptszVal);
+ if (_tcsncmp(tmpPath, _T("http://"), 7))
+ PathToAbsoluteT(dbv.ptszVal, tmpPath);
+ result = tmpPath;
}
}
db_free(&dbv);
@@ -83,29 +71,6 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) return res;
}
-const char *TemplateHTMLBuilder::getFlashAvatar(const TCHAR *file, int index)
-{
- if (time(NULL) - flashAvatarsTime[index] > 600 || flashAvatars[index] == NULL) {
- if (flashAvatars[index] != NULL) {
- mir_free(flashAvatars[index]);
- flashAvatars[index] = NULL;
- }
- flashAvatarsTime[index] = time(NULL);
- int src = _topen(file, _O_BINARY | _O_RDONLY);
- if (src != -1) {
- char pBuf[2048];
- char *urlBuf;
- _read(src, pBuf, 2048);
- _close(src);
- urlBuf = strstr(pBuf, "<URL>");
- if (urlBuf) {
- flashAvatars[index] = mir_strdup(strtok(urlBuf + 5, "<\t\n\r"));
- }
- }
- }
- return flashAvatars[index];
-}
-
TemplateMap *TemplateHTMLBuilder::getTemplateMap(ProtocolSettings * protoSettings)
{
return TemplateMap::getTemplateMap(protoSettings->getSRMMTemplateFilename());
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.h b/plugins/IEView/src/TemplateHTMLBuilder.h index b3ab10463d..1264a302cf 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.h +++ b/plugins/IEView/src/TemplateHTMLBuilder.h @@ -33,9 +33,6 @@ protected: time_t startedTime;
time_t getStartedTime();
const char *groupTemplate;
- time_t flashAvatarsTime[2];
- char * flashAvatars[2];
- const char *getFlashAvatar(const TCHAR *file, int index);
char *getAvatar(MCONTACT hContact, const char *szProto);
void buildHeadTemplate(IEView *, IEVIEWEVENT *event, ProtocolSettings* protoSettings);
void appendEventTemplate(IEView *, IEVIEWEVENT *event, ProtocolSettings* protoSettings);
|