summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tlen/src/tlen.cpp')
-rw-r--r--protocols/Tlen/src/tlen.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 34e03d3071..8c76e78b42 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -252,20 +252,19 @@ INT_PTR TlenMenuHandleInbox(void *ptr, LPARAM wParam, LPARAM lParam)
int TlenOnModulesLoaded(void *ptr, WPARAM wParam, LPARAM lParam)
{
-
char str[128];
TlenProtocol *proto = (TlenProtocol *)ptr;
/* Set all contacts to offline */
- HANDLE hContact = db_find_first();
- while (hContact != NULL) {
+
+ for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (szProto != NULL && !strcmp(szProto, proto->m_szModuleName)) {
if (db_get_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) {
db_set_w(hContact, proto->m_szModuleName, "Status", ID_STATUS_OFFLINE);
}
}
- hContact = db_find_next(hContact);
}
+
TlenMUCInit(proto);
sprintf(str, "%s", LPGEN("Incoming mail"));
SkinAddNewSoundEx("TlenMailNotify", proto->m_szModuleName, str);