summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-13 11:41:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-13 11:41:22 +0300
commiteb7d323fd508439ccf0902405f25fdc4c362ebc2 (patch)
treeaaefd34e30cfd7b3866790f0b5937b421c2cdee6
parent5e6fa506d072dd3a099d0d0498fcf52c6d55f03c (diff)
Jabber: further MyNick introduction
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp7
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp9
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp2
3 files changed, 6 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 77506a14b7..42d98300aa 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -247,10 +247,6 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const char *r
szReason = TranslateU("user banned");
}
- ptrA myNick(mir_strdup(item->nick));
- if (myNick == nullptr)
- myNick = JabberNickFromJID(m_szJabberJID);
-
GCEVENT gce = { item->si, 0 };
gce.dwFlags = GCEF_UTF8 | ((item->bChatLogging) ? 0 : GCEF_SILENT);
gce.pszNick.a = nick;
@@ -266,6 +262,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const char *r
break;
default:
+ CMStringA myNick(MyNick());
mir_cslock lck(m_csLists);
for (auto &JS : item->arResources) {
if (!mir_strcmp(resource, JS->m_szResourceName)) {
@@ -314,7 +311,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, const TiXmlElement *
szMessage = TranslateU(JABBER_GC_MSG_QUIT);
}
else {
- ptrA myNick(JabberNickFromJID(m_szJabberJID));
+ CMStringA myNick(MyNick());
GcLogUpdateMemberStatus(item, myNick, myNick, nullptr, GC_EVENT_KICK, reason);
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 1dbf0fecac..2039f4f253 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -478,10 +478,7 @@ public:
delete pInfo;
}
- ptrA tszNick(m_proto->getUStringA("Nick"));
- if (tszNick == nullptr)
- tszNick = JabberNickFromJID(m_proto->m_szJabberJID);
- SetDlgItemTextUtf(m_hwnd, IDC_NICK, tszNick);
+ SetDlgItemTextUtf(m_hwnd, IDC_NICK, m_proto->MyNick());
TEXTMETRIC tm = { 0 };
HDC hdc = GetDC(m_hwnd);
@@ -1115,7 +1112,7 @@ public:
SetDlgItemTextUtf(m_hwnd, IDC_FROM, m_from);
SetDlgItemTextUtf(m_hwnd, IDC_REASON, m_reason);
- SetDlgItemTextUtf(m_hwnd, IDC_NICK, JabberNickFromJID(m_proto->m_szJabberJID));
+ SetDlgItemTextUtf(m_hwnd, IDC_NICK, m_proto->MyNick());
Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
@@ -1147,7 +1144,7 @@ void CJabberProto::GroupchatProcessInvite(const char *roomJid, const char *from,
return;
if (m_bAutoAcceptMUC) {
- AcceptGroupchatInvite(roomJid, MyNick(HContactFromJID(m_szJabberJID)), password);
+ AcceptGroupchatInvite(roomJid, MyNick(), password);
}
else CallFunctionAsync(sttShowDialog, new CGroupchatInviteAcceptDlg(this, roomJid, from, reason, password));
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 99375fb286..d286205029 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -236,7 +236,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, uint32_t rq)
if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
- GroupchatJoinRoom(server, p, MyNick(HContactFromJID(m_szJabberJID)), item->password, true);
+ GroupchatJoinRoom(server, p, MyNick(), item->password, true);
}
}
}