Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/cloudveil/DialogHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ DialogHelper::CheckDialogResult DialogHelper::checkAndShowDialogForbidden(PeerDa
controller->show(Ui::MakeConfirmBox({
.text = tr::lng_dialog_forbidden(),
.confirmed = [=](Fn<void()>&& close) {
const auto dialogId = DeserializePeerId(peerData->id.value).value;
//const auto dialogId = DeserializePeerId(peerData->id.value).value; // this was causing 404s on unblock requests
const auto dialogId = peerData->id.value;
QString url = QString("https://messenger.cloudveil.org/unblock/%1/%2")
.arg(QString::number(userData->id.value), QString::number(dialogId));

Expand Down
13 changes: 8 additions & 5 deletions Telegram/SourceFiles/cloudveil/GlobalSecuritySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,22 @@ void GlobalSecuritySettings::checkStickerSetByDocumentAsync(DocumentData* sticke
}

void GlobalSecuritySettings::addDialogToRequest(SettingsRequest &request, PeerData *peer) {
qint64 dialogId = DeserializePeerId(peer->id.value).value;

//qint64 dialogId = DeserializePeerId(peer->id.value).value;
qint64 dialogId = peer->id.value; //for CV Manage, we want the bare value

SettingsRequest::Row row;
row.id = dialogId;

row.userName = peer->userName();
row.userName = peer->userName(); // should we be setting this one?
//If it's Chat, it can't have userName; if it's Channel or User it may.
// If there's a chance this results in 'N/A' or similar, we don't want it.
row.isMegagroup = false;
row.isPublic = false;

if (peer->isChat()) {
row.title = peer->asChat()->name();
row.userName = row.title;
row.isPublic = peer->asChat()->flags() & 0x00000040;
//row.userName = row.title; //this should not be set, was it set to solve a different problem?
row.isPublic = peer->asChat()->flags() & 0x00000040; //2025-01-18 currently, Chat can only be Private, not Public
request.groups.append(row);
}
else if (peer->isChannel()) {
Expand Down
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/cloudveil/response/SettingsResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ bool SettingsResponse::isDialogAllowed(PeerData *peer) {
return true;
}

const auto dialogId = DeserializePeerId(peer->id.value).value;
//const auto dialogId = DeserializePeerId(peer->id.value).value;
const auto dialogId = peer->id.value;
if (peer->isChat() || peer->isMegagroup()) {
return groups.contains(dialogId) && groups[dialogId];
}
Expand Down Expand Up @@ -275,7 +276,8 @@ bool SettingsResponse::isDialogSecured(PeerData *peer) {
if (peer->isUser() && peer->asUser()->isSelf()) {
return true;
}
const auto dialogId = DeserializePeerId(peer->id.value).value;
//const auto dialogId = DeserializePeerId(peer->id.value).value;
const auto dialogId = peer->id.value;
return bots.contains(dialogId) ||
channels.contains(dialogId) ||
groups.contains(dialogId) ||
Expand Down
Loading