diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-25 18:34:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-25 18:34:51 +0300 |
commit | 9885bf54f788e831a80c76001340aa68d31d2aaa (patch) | |
tree | 420ab4aa5bf868d4193c965668ae68e5855093b7 /protocols/Sametime | |
parent | c9d99d1525e2e9374ed0fa10837e82e76c3b9216 (diff) |
Group chats: ChatRoomID setting replaced with real protocol id
Diffstat (limited to 'protocols/Sametime')
-rw-r--r-- | protocols/Sametime/sametime.vcxproj.filters | 101 | ||||
-rw-r--r-- | protocols/Sametime/src/conference.cpp | 4 | ||||
-rw-r--r-- | protocols/Sametime/src/options.cpp | 37 | ||||
-rw-r--r-- | protocols/Sametime/src/session_announce_win.cpp | 2 | ||||
-rw-r--r-- | protocols/Sametime/src/userlist.cpp | 34 |
5 files changed, 91 insertions, 87 deletions
diff --git a/protocols/Sametime/sametime.vcxproj.filters b/protocols/Sametime/sametime.vcxproj.filters index 4d89fb680e..96d0377694 100644 --- a/protocols/Sametime/sametime.vcxproj.filters +++ b/protocols/Sametime/sametime.vcxproj.filters @@ -8,92 +8,92 @@ <ClCompile Include="src\files.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\channel.c"> + <ClCompile Include="src\messaging.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\cipher.c"> + <ClCompile Include="src\options.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\common.c"> + <ClCompile Include="src\places.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\error.c"> + <ClCompile Include="src\sametime.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\message.c"> + <ClCompile Include="src\sametime_proto.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\mpi\mpi.c"> + <ClCompile Include="src\sametime_session.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\mw_debug.c"> + <ClCompile Include="src\session_announce_win.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\mw_util.c"> + <ClCompile Include="src\stdafx.cxx"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\service.c"> + <ClCompile Include="src\userlist.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\session.c"> + <ClCompile Include="src\utils.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_aware.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\channel.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_conf.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\cipher.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_dir.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\common.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_ft.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\error.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_im.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\message.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_place.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\mpi\mpi.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_resolve.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\mw_debug.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\srvc_store.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\mw_util.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\meanwhile\src\st_list.c"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\service.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\messaging.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\session.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\options.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_aware.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\places.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_conf.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\sametime.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_dir.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\sametime_proto.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_ft.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\sametime_session.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_im.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\session_announce_win.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_resolve.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\stdafx.cxx"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_place.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\userlist.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\srvc_store.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> - <ClCompile Include="src\utils.cpp"> - <Filter>Source Files</Filter> + <ClCompile Include="src\meanwhile\src\st_list.c"> + <Filter>Source Files\meanwhile</Filter> </ClCompile> </ItemGroup> <ItemGroup> @@ -121,4 +121,9 @@ <Filter>Resource Files</Filter> </ResourceCompile> </ItemGroup> + <ItemGroup> + <Filter Include="Source Files\meanwhile"> + <UniqueIdentifier>{425f78cf-1344-45bb-89f5-cfe3510ea8ac}</UniqueIdentifier> + </Filter> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 27c490c388..6d1783958d 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -323,7 +323,7 @@ int CSametimeProto::ChatDeleted(MCONTACT hContact) { debugLogW(L"CSametimeProto::ChatDeleted() hContact=[%x]", hContact);
DBVARIANT dbv;
- if (!db_get_s(hContact, m_szModuleName, "ChatRoomID", &dbv)) {
+ if (!getUString(hContact, "stid", &dbv)) {
TerminateConference(dbv.pszVal);
db_free(&dbv);
}
@@ -384,7 +384,7 @@ int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM) // if user is already in our meeting,
bool not_present = true;
DBVARIANT dbv;
- if (my_conference && !db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
+ if (my_conference && !getUString(hContact, "stid", &dbv)) {
char* user_id = dbv.pszVal;
GList *members, *mem;
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index e96404360a..d34b6b5505 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -350,15 +350,15 @@ void CSametimeProto::LoadOptions() {
DBVARIANT dbv;
- if (!db_get_utf(0, m_szModuleName, "ServerName", &dbv)) {
+ if (!getUString(0, "ServerName", &dbv)) {
strncpy(options.server_name, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
- if (!db_get_utf(0, m_szModuleName, "stid", &dbv)) {
+ if (!getUString(0, "stid", &dbv)) {
strncpy(options.id, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
- if (!db_get_utf(0, m_szModuleName, "Password", &dbv)) {
+ if (!getUString(0, "Password", &dbv)) {
strncpy(options.pword, dbv.pszVal, LSTRINGLEN);
db_free(&dbv);
}
@@ -398,20 +398,19 @@ void CSametimeProto::LoadOptions() void CSametimeProto::SaveOptions()
{
- db_set_utf(0, m_szModuleName, "ServerName", options.server_name);
-
- db_set_utf(0, m_szModuleName, "stid", options.id);
- //db_set_s(0, m_szModuleName, "Nick", options.id);
- db_set_utf(0, m_szModuleName, "Password", options.pword);
-
- db_set_dw(0, m_szModuleName, "ServerPort", options.port);
- db_set_b(0, m_szModuleName, "GetServerContacts", options.get_server_contacts ? 1 : 0);
- db_set_dw(0, m_szModuleName, "ClientID", options.client_id);
- db_set_dw(0, m_szModuleName, "ClientVersionMajor", options.client_versionMajor);
- db_set_dw(0, m_szModuleName, "ClientVersionMinor", options.client_versionMinor);
- db_set_b(0, m_szModuleName, "ErrorDisplay", options.err_method);
-
- db_set_b(0, m_szModuleName, "AutoAddContacts", options.add_contacts ? 1 : 0);
- db_set_b(0, m_szModuleName, "EncryptSession", options.encrypt_session ? 1 : 0);
- db_set_b(0, m_szModuleName, "IdleAsAway", options.idle_as_away ? 1 : 0);
+ setUString("ServerName", options.server_name);
+
+ setUString("stid", options.id);
+ setUString("Password", options.pword);
+
+ setDword("ServerPort", options.port);
+ setByte("GetServerContacts", options.get_server_contacts ? 1 : 0);
+ setDword("ClientID", options.client_id);
+ setDword("ClientVersionMajor", options.client_versionMajor);
+ setDword("ClientVersionMinor", options.client_versionMinor);
+
+ setByte("ErrorDisplay", options.err_method);
+ setByte("AutoAddContacts", options.add_contacts ? 1 : 0);
+ setByte("EncryptSession", options.encrypt_session ? 1 : 0);
+ setByte("IdleAsAway", options.idle_as_away ? 1 : 0);
}
diff --git a/protocols/Sametime/src/session_announce_win.cpp b/protocols/Sametime/src/session_announce_win.cpp index 11ff040c7f..ab4d7bb495 100644 --- a/protocols/Sametime/src/session_announce_win.cpp +++ b/protocols/Sametime/src/session_announce_win.cpp @@ -102,7 +102,7 @@ INT_PTR CALLBACK SessionAnnounceDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wPara lvI.mask = LVIF_PARAM;
ListView_GetItem(GetDlgItem(hwndDlg, IDC_LST_ANTO), &lvI);
- if (!db_get_utf((MCONTACT)lvI.lParam, proto->m_szModuleName, "stid", &dbv)) {
+ if (!proto->getUString((MCONTACT)lvI.lParam, "stid", &dbv)) {
safArg->recipients = g_list_prepend(safArg->recipients, _strdup(dbv.pszVal));
mir_strcpy(p, dbv.pszVal);
safArg->recipients = g_list_prepend(safArg->recipients, _strdup(id));
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 1bc5102fff..cc64094d40 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -5,7 +5,7 @@ MCONTACT CSametimeProto::FindContactByUserId(const char* id) {
DBVARIANT dbv;
for (auto &hContact : AccContacts()) {
- if (!db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
+ if (!getUString(hContact, "stid", &dbv)) {
if (dbv.pszVal && mir_strcmp(id, dbv.pszVal) == 0) {
db_free(&dbv);
return hContact;
@@ -21,7 +21,7 @@ bool CSametimeProto::GetAwareIdFromContact(MCONTACT hContact, mwAwareIdBlock* id char *proto = Proto_GetBaseAccountName(hContact);
DBVARIANT dbv;
if (proto && !mir_strcmp(m_szModuleName, proto)) {
- if (!db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
+ if (!getUString(hContact, "stid", &dbv)) {
if (dbv.pszVal) {
id_block->type = mwAware_USER;
id_block->user = _strdup(dbv.pszVal);
@@ -73,21 +73,21 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) Contact::Hide(hContact, false);
}
-
// add to miranda
- if (new_contact) db_set_utf(hContact, m_szModuleName, "stid", id);
+ if (new_contact)
+ setUString(hContact, "stid", id);
if (name && mir_strlen(name))
- db_set_utf(hContact, m_szModuleName, "Name", name);
+ setUString(hContact, "Name", name);
- if (nick && mir_strlen(nick)) {
- db_set_utf(hContact, m_szModuleName, "Nick", nick);
+ if (mir_strlen(nick)) {
+ setUString(hContact, "Nick", nick);
}
- else if (name && mir_strlen(name)) {
- db_set_utf(hContact, m_szModuleName, "Nick", name);
+ else if (mir_strlen(name)) {
+ setUString(hContact, "Nick", name);
}
else {
- db_set_utf(hContact, m_szModuleName, "Nick", id);
+ setUString(hContact, "Nick", id);
}
db_set_b(hContact, m_szModuleName, "type", (uint8_t)type);
@@ -196,7 +196,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) mwIdBlock uid;
for (auto &hContact : AccContacts()) {
- if (!db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
+ if (!getUString(hContact, "stid", &dbv)) {
if (dbv.pszVal) {
if (GetAwareIdFromContact(hContact, &id_block)) {
if (!db_get_utf(hContact, "CList", "Group", &dbv2)) {
@@ -250,7 +250,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) free(group_name);
free(group_alias);
- if (!db_get_utf(hContact, m_szModuleName, "Name", &dbv2)) {
+ if (!getUString(hContact, "Name", &dbv2)) {
user_shortName = _strdup(dbv2.pszVal);
db_free(&dbv2);
}
@@ -451,7 +451,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware) DBVARIANT dbv;
// update self - necessary for some servers
- if (aware->online && !db_get_utf(0, proto->m_szModuleName, "stid", &dbv) && mir_strcmp(aware->id.user, dbv.pszVal) == 0) {
+ if (aware->online && !proto->getUString("stid", &dbv) && mir_strcmp(aware->id.user, dbv.pszVal) == 0) {
int new_status = ID_STATUS_OFFLINE;
switch (aware->status.status) {
@@ -587,7 +587,7 @@ void CSametimeProto::UserListCreate() for (auto &hContact : AccContacts()) {
if (!Contact::IsGroupChat(hContact, m_szModuleName) /*&& proto && !mir_strcmp( PROTO, proto)*/) {
- if (!db_get_utf(hContact, m_szModuleName, "stid", &dbv)) {
+ if (!getUString(hContact, "stid", &dbv)) {
if (dbv.pszVal) {
if (GetAwareIdFromContact(hContact, &id_block)) {
// add user to aware list
@@ -603,7 +603,7 @@ void CSametimeProto::UserListCreate() }
// add self - might be necessary for some servers
- if (!db_get_utf(0, m_szModuleName, "stid", &dbv)) {
+ if (!getUString("stid", &dbv)) {
id_block.type = mwAware_USER;
id_block.user = dbv.pszVal;
id_block.community = nullptr;
@@ -710,8 +710,8 @@ void mwResolve_handler_details_callback(mwServiceResolve* srvc, guint32, guint32 if (hContact) {
char* name = ((mwResolveMatch*)mri->data)->name;
if (name && mir_strlen(name)) {
- db_set_utf(hContact, proto->m_szModuleName, "Name", name);
- db_set_utf(hContact, proto->m_szModuleName, "Nick", name);
+ proto->setUString(hContact, "Name", name);
+ proto->setUString(hContact, "Nick", name);
db_set_utf(hContact, "CList", "MyHandle", name);
}
}
|