mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Allow RTMP for manage call admins.
This commit is contained in:
parent
338122793c
commit
762592daff
3 changed files with 13 additions and 11 deletions
|
@ -9,7 +9,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "calls/group/calls_group_common.h"
|
#include "calls/group/calls_group_common.h"
|
||||||
#include "data/data_peer.h"
|
#include "data/data_channel.h"
|
||||||
|
#include "data/data_chat.h"
|
||||||
|
#include "data/data_user.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "main/main_account.h"
|
#include "main/main_account.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
|
@ -169,7 +171,12 @@ void StartRtmpProcess::finish(JoinInfo info) {
|
||||||
void StartRtmpProcess::createBox() {
|
void StartRtmpProcess::createBox() {
|
||||||
auto done = [=] {
|
auto done = [=] {
|
||||||
const auto peer = _request->peer;
|
const auto peer = _request->peer;
|
||||||
finish({ .peer = peer, .joinAs = peer, .rtmp = true });
|
const auto joinAs = (peer->isChat() && peer->asChat()->amCreator())
|
||||||
|
? peer
|
||||||
|
: (peer->isChannel() && peer->asChannel()->amCreator())
|
||||||
|
? peer
|
||||||
|
: peer->session().user();
|
||||||
|
finish({ .peer = peer, .joinAs = joinAs, .rtmp = true });
|
||||||
};
|
};
|
||||||
auto revoke = [=] {
|
auto revoke = [=] {
|
||||||
const auto guard = base::make_weak(&_request->guard);
|
const auto guard = base::make_weak(&_request->guard);
|
||||||
|
|
|
@ -72,10 +72,8 @@ namespace {
|
||||||
|
|
||||||
constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000);
|
constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000);
|
||||||
|
|
||||||
inline bool HasGroupCallMenu(const not_null<PeerData*> &peer) {
|
[[nodiscard]] inline bool HasGroupCallMenu(not_null<PeerData*> peer) {
|
||||||
return !peer->groupCall()
|
return !peer->groupCall() && peer->canManageGroupCall();
|
||||||
&& ((peer->isChannel() && peer->asChannel()->amCreator())
|
|
||||||
|| (peer->isChat() && peer->asChat()->amCreator()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TopBarNameText(
|
QString TopBarNameText(
|
||||||
|
|
|
@ -2798,9 +2798,6 @@ bool FillVideoChatMenu(
|
||||||
const auto livestream = !peer->isMegagroup() && peer->isChannel();
|
const auto livestream = !peer->isMegagroup() && peer->isChannel();
|
||||||
const auto has = (peer->groupCall() != nullptr);
|
const auto has = (peer->groupCall() != nullptr);
|
||||||
const auto manager = peer->canManageGroupCall();
|
const auto manager = peer->canManageGroupCall();
|
||||||
const auto creator = peer->isChat()
|
|
||||||
? peer->asChat()->amCreator()
|
|
||||||
: peer->asChannel()->amCreator();
|
|
||||||
if (has) {
|
if (has) {
|
||||||
addAction(
|
addAction(
|
||||||
tr::lng_menu_start_group_call_join(tr::now),
|
tr::lng_menu_start_group_call_join(tr::now),
|
||||||
|
@ -2812,9 +2809,9 @@ bool FillVideoChatMenu(
|
||||||
? tr::lng_menu_start_group_call_channel
|
? tr::lng_menu_start_group_call_channel
|
||||||
: tr::lng_menu_start_group_call)(tr::now),
|
: tr::lng_menu_start_group_call)(tr::now),
|
||||||
[=] { callback({}); },
|
[=] { callback({}); },
|
||||||
creator ? &st::menuIconStartStream : &st::menuIconVideoChat);
|
&st::menuIconStartStream);
|
||||||
}
|
}
|
||||||
if (!has && creator) {
|
if (!has && manager) {
|
||||||
addAction(
|
addAction(
|
||||||
(livestream
|
(livestream
|
||||||
? tr::lng_menu_start_group_call_scheduled_channel
|
? tr::lng_menu_start_group_call_scheduled_channel
|
||||||
|
|
Loading…
Add table
Reference in a new issue