summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewStory/src/utils.cpp')
-rw-r--r--plugins/NewStory/src/utils.cpp170
1 files changed, 0 insertions, 170 deletions
diff --git a/plugins/NewStory/src/utils.cpp b/plugins/NewStory/src/utils.cpp
index 41ae656c75..a413a75e8c 100644
--- a/plugins/NewStory/src/utils.cpp
+++ b/plugins/NewStory/src/utils.cpp
@@ -30,173 +30,3 @@ void CopyText(HWND hwnd, const wchar_t *text)
CloseClipboard();
// GlobalFree(hMem);
}
-
-/*void ExportHistory(HANDLE hContact, char *fnTemplate, char *fn, HWND hwndHistory)
-{
-/*
- char *szHeader = "---header---";
- char *szMsgIn = "---msgin---";
- char *szMsgOut = "---msgout---";
- char *szFile = "---file---";
- char *szURL = "---url---";
- char *szStatus = "---status---";
- char *szOther = "---other---";
- char *szFooter = "---footer---";
- char *szEnd = "---end---";
-
- char *tHeader = 0;
- char *tMsgIn = 0;
- char *tMsgOut = 0;
- char *tFile = 0;
- char *tURL = 0;
- char *tStatus = 0;
- char *tOther = 0;
- char *tFooter = 0;
- char *tEnd = 0;
-
- char **tActive = 0;
- int size;
-
- char line[1024];
-
- FILE *f;
-
- f = fopen(fnTemplate, "rt");
- while (!feof(f))
- {
- fgets(line, 1024, f);
- int linesize = lstrlen(line)-1;
- if (*line) line[linesize] = 0;
-
- if (!lstrcmp(line, szHeader))
- {
- tActive = &tHeader;
- size = 0;
- } else
- if (!lstrcmp(line, szMsgIn))
- {
- tActive = &tMsgIn;
- size = 0;
- } else
- if (!lstrcmp(line, szMsgOut))
- {
- tActive = &tMsgOut;
- size = 0;
- } else
- if (!lstrcmp(line, szFile))
- {
- tActive = &tFile;
- size = 0;
- } else
- if (!lstrcmp(line, szURL))
- {
- tActive = &tURL;
- size = 0;
- } else
- if (!lstrcmp(line, szStatus))
- {
- tActive = &tStatus;
- size = 0;
- } else
- if (!lstrcmp(line, szOther))
- {
- tActive = &tOther;
- size = 0;
- } else
- if (!lstrcmp(line, szFooter))
- {
- tActive = &tFooter;
- size = 0;
- } else
- if (!lstrcmp(line, szEnd))
- {
- break;
- } else
- if (tActive)
- {
- line[linesize+0] = '\n';
- line[linesize+1] = '\0';
- *tActive = appendString(*tActive, line);
- }
- }
- fclose(f);
-
- f = fopen(fn, "wt");
- if (!f)
- {
- MessageBox(hwndHistory, Translate("Can't open optput file."), Translate("Newstory Export"), MB_ICONSTOP|MB_OK);
- free(tHeader);
- free(tMsgIn);
- free(tMsgOut);
- free(tFile);
- free(tURL);
- free(tStatus);
- free(tOther);
- free(tFooter);
- free(tEnd);
- return;
- }
-
- char *s;
-
- VFArgs args;
- args.hContact = hContact;
- args.event = 0;
-
- s = TplFormatStringEx(TPL_TITLE, tHeader, &args);
- fputs(s,f);
- free(s);
-
- int eventCount = SendMessage(hwndHistory, UM_GETEVENTCOUNT, 0, 0);
- for (int i = 0; i < eventCount; i++)
- {
- if (!SendMessage(hwndHistory, UM_SELECTED, i, 0))
- continue;
-
- args.event = (DBEVENTINFO *)SendMessage(hwndHistory, UM_GETEVENT, i, TRUE);
- switch (args.event->eventType)
- {
- case EVENTTYPE_MESSAGE:
- if (args.event->flags & DBEF_SENT)
- {
- s = TplFormatStringEx(TPL_MESSAGE, tMsgOut?tMsgOut:tOther, &args);
- } else
- {
- s = TplFormatStringEx(TPL_MESSAGE, tMsgIn?tMsgOut:tOther, &args);
- }
- break;
-
- case EVENTTYPE_FILE:
- s = TplFormatStringEx(TPL_FILE, tFile?tFile:tOther, &args);
- break;
-
- case EVENTTYPE_STATUSCHANGE:
- s = TplFormatStringEx(TPL_SIGN, tStatus?tStatus:tOther, &args);
- break;
-
- default:
- s = TplFormatStringEx(TPL_OTHER, tOther, &args);
- break;
- }
-
- fputs(s,f);
- free(s);
- }
-
- s = TplFormatStringEx(TPL_TITLE, tHeader, &args);
- fputs(s,f);
- free(s);
-
- fclose(f);
-
- free(tHeader);
- free(tMsgIn);
- free(tMsgOut);
- free(tFile);
- free(tURL);
- free(tStatus);
- free(tOther);
- free(tFooter);
- free(tEnd);
-
-}*/