Update API scheme on layer 148: Topic icons.
18
Telegram/Resources/art/topic_icons/blue.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic blue</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#4BB7FF" offset="0%"></stop>
|
||||
<stop stop-color="#015EC1" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||
<stop stop-color="#0888DF" offset="0%"></stop>
|
||||
<stop stop-color="#0042AC" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-blue" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.47368421 C52.6535116,4.47368421 62.3029461,8.44172846 69.286057,14.8715044 C76.2233062,21.2590526 80.5263158,30.0798831 80.5263158,39.8304382 C80.5263158,49.5809933 76.2233062,58.4018239 69.286057,64.7893721 C62.3029461,71.219148 52.6535116,75.1871923 42,75.1871923 C37.5267059,75.1871923 33.2308553,74.4877643 29.2348341,73.2001187 C29.0182529,73.1303293 28.8019654,73.0586229 28.5862413,72.9852481 C28.3948519,73.106612 28.2000814,73.2292009 28.0019297,73.3530173 C26.1800899,74.4914063 24.5768234,75.4183854 23.1902273,76.1332316 C19.9632993,77.7968433 15.8838664,78.895322 10.968708,79.4573148 L10.3331597,79.5269374 C10.8475353,78.5381033 11.3155893,77.6262907 11.7364879,76.7897918 L12.0856904,76.0911971 C13.1548056,73.9371347 13.8747553,72.3343394 14.2288664,71.2486595 C14.8154652,69.4501884 15.1095499,67.6701625 15.2363061,66.0328103 C15.2549358,65.7921643 15.2704685,65.5479168 15.2812363,65.2994157 C15.1072303,65.1457013 14.9345381,64.9902431 14.7631844,64.8330639 C7.79678435,58.4429296 3.47368421,49.6037286 3.47368421,39.8304382 C3.47368421,30.0798831 7.77669379,21.2590526 14.713943,14.8715044 C21.6970539,8.44172846 31.3464884,4.47368421 42,4.47368421 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.94736842" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#71D0FF" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
18
Telegram/Resources/art/topic_icons/gray.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic gray</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#A5A5A5" offset="0%"></stop>
|
||||
<stop stop-color="#616161" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||
<stop stop-color="#737373" offset="0%"></stop>
|
||||
<stop stop-color="#565656" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-gray" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.47368421 C52.6535116,4.47368421 62.3029461,8.44172846 69.286057,14.8715044 C76.2233062,21.2590526 80.5263158,30.0798831 80.5263158,39.8304382 C80.5263158,49.5809933 76.2233062,58.4018239 69.286057,64.7893721 C62.3029461,71.219148 52.6535116,75.1871923 42,75.1871923 C37.5267059,75.1871923 33.2308553,74.4877643 29.2348341,73.2001187 C29.0182529,73.1303293 28.8019654,73.0586229 28.5862413,72.9852481 C28.3948519,73.106612 28.2000814,73.2292009 28.0019297,73.3530173 C26.1800899,74.4914063 24.5768234,75.4183854 23.1902273,76.1332316 C19.9632993,77.7968433 15.8838664,78.895322 10.968708,79.4573148 L10.3331597,79.5269374 C10.8475353,78.5381033 11.3155893,77.6262907 11.7364879,76.7897918 L12.0856904,76.0911971 C13.1548056,73.9371347 13.8747553,72.3343394 14.2288664,71.2486595 C14.8154652,69.4501884 15.1095499,67.6701625 15.2363061,66.0328103 C15.2549358,65.7921643 15.2704685,65.5479168 15.2812363,65.2994157 C15.1072303,65.1457013 14.9345381,64.9902431 14.7631844,64.8330639 C7.79678435,58.4429296 3.47368421,49.6037286 3.47368421,39.8304382 C3.47368421,30.0798831 7.77669379,21.2590526 14.713943,14.8715044 C21.6970539,8.44172846 31.3464884,4.47368421 42,4.47368421 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.94736842" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#B8B8B8" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
18
Telegram/Resources/art/topic_icons/green.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic green</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.7635421%" id="linearGradient-1">
|
||||
<stop stop-color="#97E334" offset="0%"></stop>
|
||||
<stop stop-color="#11B411" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="98.9250576%" id="linearGradient-2">
|
||||
<stop stop-color="#48AF18" offset="0%"></stop>
|
||||
<stop stop-color="#05951A" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-green" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#C2FF71" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/red.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic red</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#FF714C" offset="0%"></stop>
|
||||
<stop stop-color="#C61505" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="98.6056043%" id="linearGradient-2">
|
||||
<stop stop-color="#E12F1F" offset="0%"></stop>
|
||||
<stop stop-color="#B40101" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-red" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#FFB47D" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/rose.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic rose</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="4.31422203%" x2="50%" y2="99.6023762%" id="linearGradient-1">
|
||||
<stop stop-color="#FF7999" offset="0%"></stop>
|
||||
<stop stop-color="#E4215A" offset="98.5968743%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="96.4024371%" id="linearGradient-2">
|
||||
<stop stop-color="#F83B72" offset="0%"></stop>
|
||||
<stop stop-color="#BA0940" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-rose" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#FFC7D6" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/violet.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic violet</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.7635421%" id="linearGradient-1">
|
||||
<stop stop-color="#E57AFF" offset="0%"></stop>
|
||||
<stop stop-color="#A438BB" offset="99.8550522%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.39588%" id="linearGradient-2">
|
||||
<stop stop-color="#B239D1" offset="0%"></stop>
|
||||
<stop stop-color="#7C279A" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-violet" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#F5BDFF" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
18
Telegram/Resources/art/topic_icons/yellow.svg
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="84px" height="84px" viewBox="0 0 84 84" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>topic yellow</title>
|
||||
<defs>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
|
||||
<stop stop-color="#FFDB5C" offset="0%"></stop>
|
||||
<stop stop-color="#EA5800" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
<linearGradient x1="50%" y1="0%" x2="50%" y2="99.0141482%" id="linearGradient-2">
|
||||
<stop stop-color="#F2A807" offset="0%"></stop>
|
||||
<stop stop-color="#D93A00" offset="100%"></stop>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g id="topic-yellow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M42,4.42105263 C52.6675181,4.42105263 62.3294728,8.39460913 69.3217075,14.8327858 C76.2697184,21.230243 80.5789474,30.0648871 80.5789474,39.8304382 C80.5789474,49.5959894 76.2697184,58.4306335 69.3217075,64.8280906 C62.3294728,71.2662674 52.6675181,75.2398239 42,75.2398239 C37.5210466,75.2398239 33.2197662,74.5394876 29.2186919,73.2502137 C29.0098956,73.1829329 28.8013719,73.1138726 28.5929684,73.0432995 C28.4083865,73.1602808 28.2206704,73.2783974 28.0298198,73.3976517 C26.2065565,74.5369301 24.6020235,75.4646079 23.2143446,76.1800123 C19.9826132,77.8461004 15.8972513,78.9467661 10.9744394,79.5096334 L10.3380323,79.5793501 C12.3422829,75.5502987 13.657562,72.8305079 14.1788292,71.2323391 C14.7640488,69.4380965 15.0573738,67.6622454 15.1838316,66.0287479 C15.2017691,65.7970433 15.21683,65.561992 15.2283048,65.3228731 C15.0601712,65.1741519 14.8932645,65.0238038 14.727607,64.8718496 C7.75040024,58.4718025 3.42105263,49.6187586 3.42105263,39.8304382 C3.42105263,30.0648871 7.7302816,21.230243 14.6782925,14.8327858 C21.6705272,8.39460913 31.3324819,4.42105263 42,4.42105263 Z" id="Combined-Shape-Copy-2" stroke="url(#linearGradient-2)" stroke-width="2.84210526" fill="url(#linearGradient-1)"></path>
|
||||
<path d="M9.68078613,24.6137047 C9.8721537,24.8136848 10.1894036,24.8206666 10.3893837,24.629299 C10.3964827,24.6225057 10.4033805,24.6155051 10.410082,24.6083194 C20.5178445,13.7276637 31.3141669,8.50123177 42.7990494,8.92902374 C54.2584365,9.35586606 64.9235425,15.3681505 74.7943671,26.9658769 C75.0309355,27.243826 75.4426222,27.2904538 75.7353592,27.0724506 C76.0315877,26.8518473 76.1075038,26.440096 75.9094038,26.1283693 C67.7821181,13.3374534 56.7453333,6.69089625 42.7990494,6.18869781 C28.8220513,5.68539338 17.7581791,11.5492352 9.60743269,23.7802233 C9.4336795,24.0409463 9.46416665,24.3873362 9.68078613,24.6137047 Z" id="Path-22" fill="#F9FF71" opacity="0.37491644"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -28,6 +28,13 @@
|
|||
<file alias="icons/settings/dino.svg">../../icons/settings/dino.svg</file>
|
||||
<file alias="icons/settings/star.svg">../../icons/settings/star.svg</file>
|
||||
<file alias="icons/settings/starmini.svg">../../icons/settings/starmini.svg</file>
|
||||
<file alias="topic_icons/blue.svg">../../art/topic_icons/blue.svg</file>
|
||||
<file alias="topic_icons/yellow.svg">../../art/topic_icons/yellow.svg</file>
|
||||
<file alias="topic_icons/violet.svg">../../art/topic_icons/violet.svg</file>
|
||||
<file alias="topic_icons/green.svg">../../art/topic_icons/green.svg</file>
|
||||
<file alias="topic_icons/rose.svg">../../art/topic_icons/rose.svg</file>
|
||||
<file alias="topic_icons/red.svg">../../art/topic_icons/red.svg</file>
|
||||
<file alias="topic_icons/gray.svg">../../art/topic_icons/gray.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/icons">
|
||||
<file alias="calls/hands.lottie">../../icons/calls/hands.lottie</file>
|
||||
|
|
|
@ -192,9 +192,8 @@ messageActionChatJoinedByRequest#ebbca3cb = MessageAction;
|
|||
messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;
|
||||
messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;
|
||||
messageActionGiftPremium#aba0f5c6 currency:string amount:long months:int = MessageAction;
|
||||
messageActionTopicCreate#6fa796ac flags:# title:string icon_emoji_id:flags.0?long = MessageAction;
|
||||
messageActionTopicEditTitle#ce0b23cd title:string = MessageAction;
|
||||
messageActionTopicEditIcon#820a6e2b emoji_document_id:long = MessageAction;
|
||||
messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;
|
||||
messageActionTopicEdit#b117a9f5 flags:# title:flags.0?string icon_emoji_id:flags.1?long = MessageAction;
|
||||
|
||||
dialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
|
||||
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
|
||||
|
@ -1455,7 +1454,7 @@ stickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword
|
|||
|
||||
username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;
|
||||
|
||||
forumTopic#2f3e1a06 flags:# id:int date:int title:string icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int = ForumTopic;
|
||||
forumTopic#18a9a864 flags:# my:flags.1?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer = ForumTopic;
|
||||
|
||||
messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;
|
||||
|
||||
|
@ -1862,11 +1861,10 @@ channels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;
|
|||
channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;
|
||||
channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;
|
||||
channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;
|
||||
channels.createForumTopic#60bf3bc9 flags:# channel:InputChannel title:string icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
|
||||
channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
|
||||
channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;
|
||||
channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;
|
||||
channels.editForumTitle#8881b9b1 channel:InputChannel topic_id:int title:string = Updates;
|
||||
channels.editForumIcon#55cea2dd channel:InputChannel topic_id:int emoji_document_id:long = Updates;
|
||||
channels.editForumTopic#8a7f464b flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long = Updates;
|
||||
|
||||
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
|
||||
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
|
||||
|
|
|
@ -9,11 +9,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "ui/widgets/input_fields.h"
|
||||
#include "ui/abstract_button.h"
|
||||
#include "ui/color_int_conversion.h"
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_forum.h"
|
||||
#include "data/data_forum_topic.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
#include "base/random.h"
|
||||
#include "main/main_session.h"
|
||||
#include "history/history.h"
|
||||
#include "history/view/history_view_replies_section.h"
|
||||
|
@ -22,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "window/window_session_controller.h"
|
||||
#include "settings/settings_common.h"
|
||||
#include "apiwrap.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
#include "styles/style_dialogs.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -34,34 +36,39 @@ namespace {
|
|||
[[nodiscard]] rpl::producer<DocumentId> EditIconButton(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<QWidget*> parent,
|
||||
DocumentId id) {
|
||||
int32 colorId,
|
||||
DocumentId iconId) {
|
||||
using namespace Info::Profile;
|
||||
struct State {
|
||||
rpl::variable<DocumentId> id;
|
||||
rpl::variable<DocumentId> iconId;
|
||||
EmojiStatusPanel panel;
|
||||
std::unique_ptr<Ui::Text::CustomEmoji> chosen;
|
||||
QImage empty;
|
||||
};
|
||||
const auto tag = Data::CustomEmojiManager::SizeTag::Large;
|
||||
const auto size = EditIconSize();
|
||||
const auto result = Ui::CreateChild<Ui::AbstractButton>(parent.get());
|
||||
const auto state = result->lifetime().make_state<State>();
|
||||
state->id.value(
|
||||
) | rpl::start_with_next([=](DocumentId id) {
|
||||
state->empty = Data::ForumTopicIconBackground(
|
||||
colorId,
|
||||
st::largeForumTopicIcon.size);
|
||||
state->iconId.value(
|
||||
) | rpl::start_with_next([=](DocumentId iconId) {
|
||||
const auto owner = &controller->session().data();
|
||||
state->chosen = id
|
||||
state->chosen = iconId
|
||||
? owner->customEmojiManager().create(
|
||||
id,
|
||||
iconId,
|
||||
[=] { result->update(); },
|
||||
tag)
|
||||
: nullptr;
|
||||
result->update();
|
||||
}, result->lifetime());
|
||||
state->id = id;
|
||||
state->iconId = iconId;
|
||||
state->panel.setChooseFilter([=](DocumentId) {
|
||||
return true;
|
||||
});
|
||||
state->panel.setChooseCallback([=](DocumentId id) {
|
||||
state->id = id;
|
||||
state->iconId = id;
|
||||
});
|
||||
result->resize(size, size);
|
||||
result->paintRequest(
|
||||
|
@ -78,14 +85,14 @@ namespace {
|
|||
if (state->chosen) {
|
||||
state->chosen->paint(p, args);
|
||||
} else {
|
||||
// #TODO forum
|
||||
st::stickersPremium.paint(p, 0, 0, result->width());
|
||||
const auto skip = (size - st::largeForumTopicIcon.size) / 2;
|
||||
p.drawImage(skip, skip, state->empty);
|
||||
}
|
||||
}, result->lifetime());
|
||||
result->setClickedCallback([=] {
|
||||
state->panel.show(controller, result, tag);
|
||||
});
|
||||
return state->id.value();
|
||||
return state->iconId.value();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -110,11 +117,16 @@ void EditForumTopicBox(
|
|||
box->setTitle(rpl::single(creating ? u"New topic"_q : u"Edit topic"_q));
|
||||
|
||||
struct State {
|
||||
int32 colorId = 0;
|
||||
DocumentId iconId = 0;
|
||||
mtpRequestId titleRequestId = 0;
|
||||
mtpRequestId iconRequestId = 0;
|
||||
mtpRequestId requestId = 0;
|
||||
};
|
||||
const auto state = box->lifetime().make_state<State>();
|
||||
const auto &colors = Data::ForumTopicColorIds();
|
||||
state->iconId = topic ? topic->iconId() : 0;
|
||||
state->colorId = topic
|
||||
? topic->colorId()
|
||||
: colors[base::RandomIndex(colors.size())];
|
||||
// #TODO forum lang and design
|
||||
Settings::AddSubsectionTitle(
|
||||
box->verticalLayout(),
|
||||
|
@ -124,7 +136,8 @@ void EditForumTopicBox(
|
|||
EditIconButton(
|
||||
controller,
|
||||
badgeWrap,
|
||||
topic ? topic->iconId() : 0
|
||||
state->colorId,
|
||||
state->iconId
|
||||
) | rpl::start_with_next([=](DocumentId id) {
|
||||
state->iconId = id;
|
||||
}, box->lifetime());
|
||||
|
@ -154,6 +167,7 @@ void EditForumTopicBox(
|
|||
forum,
|
||||
channel->forum()->reserveCreatingId(
|
||||
title->getLastText().trimmed(),
|
||||
state->colorId,
|
||||
state->iconId)),
|
||||
Window::SectionShow::Way::ClearStack);
|
||||
};
|
||||
|
@ -166,59 +180,32 @@ void EditForumTopicBox(
|
|||
if (!topic) {
|
||||
box->closeBox();
|
||||
return;
|
||||
}
|
||||
const auto api = &forum->session().api();
|
||||
if (state->titleRequestId <= 0) {
|
||||
if (title->getLastText().trimmed().isEmpty()) {
|
||||
title->showError();
|
||||
return;
|
||||
} else if (parent->creating(rootId)) {
|
||||
topic->applyTitle(title->getLastText().trimmed());
|
||||
} else {
|
||||
const auto done = [=] {
|
||||
state->titleRequestId = 0;
|
||||
if (!state->iconRequestId) {
|
||||
box->closeBox();
|
||||
}
|
||||
};
|
||||
state->titleRequestId = api->request(MTPchannels_EditForumTitle(
|
||||
topic->channel()->inputChannel,
|
||||
MTP_int(rootId),
|
||||
MTP_string(title->getLastText().trimmed())
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->applyUpdates(result);
|
||||
done();
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
if (error.type() == u"TOPIC_NOT_MODIFIED") {
|
||||
done();
|
||||
} else {
|
||||
state->titleRequestId = -1;
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
if (parent->creating(rootId)) {
|
||||
} else if (state->requestId > 0) {
|
||||
return;
|
||||
} else if (title->getLastText().trimmed().isEmpty()) {
|
||||
title->showError();
|
||||
return;
|
||||
} else if (parent->creating(rootId)) {
|
||||
topic->applyTitle(title->getLastText().trimmed());
|
||||
topic->applyColorId(state->colorId);
|
||||
topic->applyIconId(state->iconId);
|
||||
box->closeBox();
|
||||
} else if (state->iconRequestId <= 0) {
|
||||
const auto done = [=] {
|
||||
state->iconRequestId = 0;
|
||||
if (!state->titleRequestId) {
|
||||
box->closeBox();
|
||||
}
|
||||
};
|
||||
state->iconRequestId = api->request(MTPchannels_EditForumIcon(
|
||||
} else {
|
||||
using Flag = MTPchannels_EditForumTopic::Flag;
|
||||
const auto api = &forum->session().api();
|
||||
state->requestId = api->request(MTPchannels_EditForumTopic(
|
||||
MTP_flags(Flag::f_title | Flag::f_icon_emoji_id),
|
||||
topic->channel()->inputChannel,
|
||||
MTP_int(rootId),
|
||||
MTP_string(title->getLastText().trimmed()),
|
||||
MTP_long(state->iconId)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
api->applyUpdates(result);
|
||||
done();
|
||||
box->closeBox();
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
if (error.type() == u"TOPIC_NOT_MODIFIED") {
|
||||
done();
|
||||
box->closeBox();
|
||||
} else {
|
||||
state->iconRequestId = -1;
|
||||
state->requestId = -1;
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ CloudTheme CloudTheme::Parse(
|
|||
settings.match([&](const MTPDthemeSettings &data) {
|
||||
if (const auto colors = data.vmessage_colors()) {
|
||||
for (const auto &color : colors->v) {
|
||||
result.push_back(ColorFromSerialized(color));
|
||||
result.push_back(Ui::ColorFromSerialized(color));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -57,12 +57,12 @@ CloudTheme CloudTheme::Parse(
|
|||
};
|
||||
const auto accentColor = [&](const MTPThemeSettings &settings) {
|
||||
return settings.match([&](const MTPDthemeSettings &data) {
|
||||
return ColorFromSerialized(data.vaccent_color().v);
|
||||
return Ui::ColorFromSerialized(data.vaccent_color());
|
||||
});
|
||||
};
|
||||
const auto outgoingAccentColor = [&](const MTPThemeSettings &settings) {
|
||||
return settings.match([&](const MTPDthemeSettings &data) {
|
||||
return MaybeColorFromSerialized(data.voutbox_accent_color());
|
||||
return Ui::MaybeColorFromSerialized(data.voutbox_accent_color());
|
||||
});
|
||||
};
|
||||
const auto basedOnDark = [&](const MTPThemeSettings &settings) {
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace {
|
|||
|
||||
constexpr auto kTopicsFirstLoad = 20;
|
||||
constexpr auto kTopicsPerPage = 500;
|
||||
constexpr auto kGeneralColorId = 0xA9A9A9;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -123,6 +124,7 @@ void Forum::applyReceivedTopics(
|
|||
void Forum::applyTopicAdded(
|
||||
MsgId rootId,
|
||||
const QString &title,
|
||||
int32 colorId,
|
||||
DocumentId iconId) {
|
||||
const auto i = _topics.find(rootId);
|
||||
const auto raw = (i != end(_topics))
|
||||
|
@ -132,6 +134,7 @@ void Forum::applyTopicAdded(
|
|||
std::make_unique<ForumTopic>(_history, rootId)
|
||||
).first->second.get();
|
||||
raw->applyTitle(title);
|
||||
raw->applyColorId(colorId);
|
||||
raw->applyIconId(iconId);
|
||||
if (!creating(rootId)) {
|
||||
raw->addToChatList(FilterId(), topicsList());
|
||||
|
@ -147,10 +150,11 @@ void Forum::applyTopicRemoved(MsgId rootId) {
|
|||
|
||||
MsgId Forum::reserveCreatingId(
|
||||
const QString &title,
|
||||
int32 colorId,
|
||||
DocumentId iconId) {
|
||||
const auto result = _history->owner().nextLocalMessageId();
|
||||
_creatingRootIds.emplace(result);
|
||||
applyTopicAdded(result, title, iconId);
|
||||
applyTopicAdded(result, title, colorId, iconId);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -200,7 +204,7 @@ ForumTopic *Forum::topicFor(MsgId rootId) {
|
|||
}
|
||||
} else {
|
||||
// #TODO forum lang
|
||||
applyTopicAdded(rootId, "General! Created.", DocumentId(0));
|
||||
applyTopicAdded(rootId, "General! Created.", kGeneralColorId, 0);
|
||||
return _topics.find(rootId)->second.get();
|
||||
}
|
||||
return nullptr;
|
||||
|
|
|
@ -34,6 +34,7 @@ public:
|
|||
void applyTopicAdded(
|
||||
MsgId rootId,
|
||||
const QString &title,
|
||||
int32 colorId,
|
||||
DocumentId iconId);
|
||||
void applyTopicRemoved(MsgId rootId);
|
||||
void applyTopicCreated(MsgId rootId, MsgId realId);
|
||||
|
@ -44,6 +45,7 @@ public:
|
|||
|
||||
[[nodiscard]] MsgId reserveCreatingId(
|
||||
const QString &title,
|
||||
int32 colorId,
|
||||
DocumentId iconId);
|
||||
void discardCreatingId(MsgId rootId);
|
||||
[[nodiscard]] bool creating(MsgId rootId) const;
|
||||
|
|
|
@ -18,11 +18,110 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "history/history.h"
|
||||
#include "history/history_item.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/color_int_conversion.h"
|
||||
#include "styles/style_dialogs.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
|
||||
#include <QtSvg/QSvgRenderer>
|
||||
|
||||
namespace Data {
|
||||
|
||||
const base::flat_map<int32, QString> &ForumTopicIcons() {
|
||||
static const auto Result = base::flat_map<int32, QString>{
|
||||
{ 0x6FB9F0, u"blue"_q },
|
||||
{ 0xFFD67E, u"yellow"_q },
|
||||
{ 0xCB86DB, u"violet"_q },
|
||||
{ 0x8EEE98, u"green"_q },
|
||||
{ 0xFF93B2, u"rose"_q },
|
||||
{ 0xFB6F5F, u"red"_q },
|
||||
};
|
||||
return Result;
|
||||
}
|
||||
|
||||
const std::vector<int32> &ForumTopicColorIds() {
|
||||
static const auto Result = ForumTopicIcons(
|
||||
) | ranges::views::transform([](const auto &pair) {
|
||||
return pair.first;
|
||||
}) | ranges::to_vector;
|
||||
return Result;
|
||||
}
|
||||
|
||||
const QString &ForumTopicDefaultIcon() {
|
||||
static const auto Result = u"gray"_q;
|
||||
return Result;
|
||||
}
|
||||
|
||||
const QString &ForumTopicIcon(int32 colorId) {
|
||||
const auto &icons = ForumTopicIcons();
|
||||
const auto i = icons.find(colorId);
|
||||
return (i != end(icons)) ? i->second : ForumTopicDefaultIcon();
|
||||
}
|
||||
|
||||
QString ForumTopicIconPath(const QString &name) {
|
||||
return u":/gui/topic_icons/%1.svg"_q.arg(name);
|
||||
}
|
||||
|
||||
QImage ForumTopicIconBackground(int32 colorId, int size) {
|
||||
const auto ratio = style::DevicePixelRatio();
|
||||
auto svg = QSvgRenderer(ForumTopicIconPath(ForumTopicIcon(colorId)));
|
||||
auto result = QImage(
|
||||
QSize(size, size) * ratio,
|
||||
QImage::Format_ARGB32_Premultiplied);
|
||||
result.setDevicePixelRatio(ratio);
|
||||
result.fill(Qt::transparent);
|
||||
|
||||
auto p = QPainter(&result);
|
||||
svg.render(&p, QRect(0, 0, size, size));
|
||||
p.end();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QString ExtractNonEmojiLetter(const QString &title) {
|
||||
const auto begin = title.data();
|
||||
const auto end = begin + title.size();
|
||||
for (auto ch = begin; ch != end;) {
|
||||
auto length = 0;
|
||||
if (Ui::Emoji::Find(ch, end, &length)) {
|
||||
ch += length;
|
||||
continue;
|
||||
}
|
||||
uint ucs4 = ch->unicode();
|
||||
length = 1;
|
||||
if (QChar::isHighSurrogate(ucs4) && ch + 1 != end) {
|
||||
ushort low = ch[1].unicode();
|
||||
if (QChar::isLowSurrogate(low)) {
|
||||
ucs4 = QChar::surrogateToUcs4(ucs4, low);
|
||||
length = 2;
|
||||
}
|
||||
}
|
||||
if (!QChar::isLetterOrNumber(ucs4)) {
|
||||
ch += length;
|
||||
continue;
|
||||
}
|
||||
return QString(ch, length);
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
QImage ForumTopicIconFrame(
|
||||
int32 colorId,
|
||||
const QString &title,
|
||||
const style::ForumTopicIcon &st) {
|
||||
auto background = ForumTopicIconBackground(colorId, st.size);
|
||||
|
||||
if (const auto one = ExtractNonEmojiLetter(title); !one.isEmpty()) {
|
||||
auto p = QPainter(&background);
|
||||
p.setPen(Qt::white);
|
||||
p.drawText(
|
||||
QRect(0, st.textTop, st.size, st.font->height * 2),
|
||||
one,
|
||||
style::al_top);
|
||||
}
|
||||
|
||||
return background;
|
||||
}
|
||||
|
||||
ForumTopic::ForumTopic(not_null<History*> history, MsgId rootId)
|
||||
: Entry(&history->owner(), Type::ForumTopic)
|
||||
, _history(history)
|
||||
|
@ -62,6 +161,7 @@ void ForumTopic::applyTopic(const MTPForumTopic &topic) {
|
|||
} else {
|
||||
applyIconId(0);
|
||||
}
|
||||
applyColorId(data.vicon_color().v);
|
||||
|
||||
const auto pinned = _list->pinned();
|
||||
#if 0 // #TODO forum pinned
|
||||
|
@ -218,19 +318,29 @@ void ForumTopic::paintUserpic(
|
|||
std::shared_ptr<Data::CloudImageView> &view,
|
||||
const Dialogs::Ui::PaintContext &context) const {
|
||||
const auto &st = context.st;
|
||||
const auto position = QPoint(st->padding.left(), st->padding.top());
|
||||
if (_icon) {
|
||||
_icon->paint(p, {
|
||||
.preview = st::windowBgOver->c,
|
||||
.now = context.now,
|
||||
.position = QPoint(st->padding.left(), st->padding.top()),
|
||||
.position = position,
|
||||
.paused = context.paused,
|
||||
});
|
||||
} else {
|
||||
// #TODO forum
|
||||
st::stickersPremium.paint(
|
||||
p,
|
||||
QPoint(st->padding.left(), st->padding.top()),
|
||||
st->padding.left() * 2 + st::stickersPremium.width());
|
||||
validateDefaultIcon();
|
||||
const auto size = st::defaultForumTopicIcon.size;
|
||||
const auto esize = st::emojiSize;
|
||||
const auto shift = (esize - size) / 2;
|
||||
p.drawImage(position + QPoint(shift, shift), _defaultIcon);
|
||||
}
|
||||
}
|
||||
|
||||
void ForumTopic::validateDefaultIcon() const {
|
||||
if (_defaultIcon.isNull()) {
|
||||
_defaultIcon = ForumTopicIconFrame(
|
||||
_colorId,
|
||||
_title,
|
||||
st::defaultForumTopicIcon);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,6 +401,7 @@ void ForumTopic::applyTitle(const QString &title) {
|
|||
}
|
||||
_title = isGeneral() ? "General! Topic." : title; // #TODO forum lang
|
||||
++_titleVersion;
|
||||
_defaultIcon = QImage();
|
||||
indexTitleParts();
|
||||
updateChatListEntry();
|
||||
}
|
||||
|
@ -308,10 +419,21 @@ void ForumTopic::applyIconId(DocumentId iconId) {
|
|||
[=] { updateChatListEntry(); },
|
||||
Data::CustomEmojiManager::SizeTag::Normal)
|
||||
: nullptr;
|
||||
if (iconId) {
|
||||
_defaultIcon = QImage();
|
||||
}
|
||||
}
|
||||
updateChatListEntry();
|
||||
}
|
||||
|
||||
int32 ForumTopic::colorId() const {
|
||||
return _colorId;
|
||||
}
|
||||
|
||||
void ForumTopic::applyColorId(int32 colorId) {
|
||||
_colorId = colorId;
|
||||
}
|
||||
|
||||
void ForumTopic::applyItemAdded(not_null<HistoryItem*> item) {
|
||||
setLastMessage(item);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
class ChannelData;
|
||||
|
||||
namespace style {
|
||||
struct ForumTopicIcon;
|
||||
} // namespace style
|
||||
|
||||
namespace Dialogs {
|
||||
class MainList;
|
||||
} // namespace Dialogs
|
||||
|
@ -25,6 +29,16 @@ namespace Data {
|
|||
class Session;
|
||||
class Forum;
|
||||
|
||||
[[nodiscard]] const base::flat_map<int32, QString> &ForumTopicIcons();
|
||||
[[nodiscard]] const std::vector<int32> &ForumTopicColorIds();
|
||||
[[nodiscard]] const QString &ForumTopicIcon(int32 colorId);
|
||||
[[nodiscard]] QString ForumTopicIconPath(const QString &name);
|
||||
[[nodiscard]] QImage ForumTopicIconBackground(int32 colorId, int size);
|
||||
[[nodiscard]] QImage ForumTopicIconFrame(
|
||||
int32 colorId,
|
||||
const QString &title,
|
||||
const style::ForumTopicIcon &st);
|
||||
|
||||
class ForumTopic final : public Dialogs::Entry {
|
||||
public:
|
||||
static constexpr auto kGeneralId = 1;
|
||||
|
@ -72,6 +86,8 @@ public:
|
|||
void applyTitle(const QString &title);
|
||||
[[nodiscard]] DocumentId iconId() const;
|
||||
void applyIconId(DocumentId iconId);
|
||||
[[nodiscard]] int32 colorId() const;
|
||||
void applyColorId(int32 colorId);
|
||||
void applyItemAdded(not_null<HistoryItem*> item);
|
||||
void applyItemRemoved(MsgId id);
|
||||
|
||||
|
@ -95,6 +111,7 @@ public:
|
|||
|
||||
private:
|
||||
void indexTitleParts();
|
||||
void validateDefaultIcon() const;
|
||||
void applyTopicTopMessage(MsgId topMessageId);
|
||||
void applyTopicFields(
|
||||
int unreadCount,
|
||||
|
@ -119,8 +136,10 @@ private:
|
|||
base::flat_set<QString> _titleWords;
|
||||
base::flat_set<QChar> _titleFirstLetters;
|
||||
int _titleVersion = 0;
|
||||
int32 _colorId = 0;
|
||||
|
||||
std::unique_ptr<Ui::Text::CustomEmoji> _icon;
|
||||
mutable QImage _defaultIcon; // on-demand
|
||||
|
||||
std::optional<MsgId> _inboxReadBefore;
|
||||
std::optional<MsgId> _outboxReadBefore;
|
||||
|
|
|
@ -860,18 +860,15 @@ void Histories::sendCreateTopicRequest(
|
|||
const auto api = &session().api();
|
||||
using Flag = MTPchannels_CreateForumTopic::Flag;
|
||||
api->request(MTPchannels_CreateForumTopic(
|
||||
MTP_flags(topic->iconId() ? Flag::f_icon_emoji_id : Flag(0)),
|
||||
MTP_flags(Flag::f_icon_color
|
||||
| (topic->iconId() ? Flag::f_icon_emoji_id : Flag(0))),
|
||||
history->peer->asChannel()->inputChannel,
|
||||
MTP_string(topic->title()),
|
||||
MTP_int(topic->colorId()),
|
||||
MTP_long(topic->iconId()),
|
||||
MTP_long(randomId),
|
||||
MTPInputPeer() // send_as
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
//AssertIsDebug();
|
||||
//const auto id = result.c_updates().vupdates().v.front().c_updateMessageID().vrandom_id().v;
|
||||
//session().data().registerMessageRandomId(
|
||||
// id,
|
||||
// { history->peer->id, rootId });
|
||||
api->applyUpdates(result, randomId);
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
api->sendMessageFail(error, history->peer, randomId);
|
||||
|
@ -952,14 +949,14 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realId) {
|
|||
const auto history = _owner->history(rootId.peer);
|
||||
for (auto &entry : scheduled) {
|
||||
_creatingTopicRequests.erase(entry.requestId);
|
||||
//AssertIsDebug();
|
||||
sendPreparedMessage(
|
||||
history,
|
||||
realId,
|
||||
entry.randomId,
|
||||
std::move(entry.message),
|
||||
std::move(entry.done),
|
||||
std::move(entry.fail));
|
||||
AssertIsDebug();
|
||||
//sendPreparedMessage(
|
||||
// history,
|
||||
// realId,
|
||||
// entry.randomId,
|
||||
// std::move(entry.message),
|
||||
// std::move(entry.done),
|
||||
// std::move(entry.fail));
|
||||
}
|
||||
for (const auto &item : history->clientSideMessages()) {
|
||||
const auto replace = [&](MsgId nowId) {
|
||||
|
|
|
@ -260,7 +260,7 @@ void RepliesList::injectRootMessage(not_null<Viewer*> viewer) {
|
|||
return;
|
||||
}
|
||||
const auto root = lookupRoot();
|
||||
if (!root) {
|
||||
if (!root || root->topicRootId() != Data::ForumTopic::kGeneralId) {
|
||||
return;
|
||||
}
|
||||
injectRootDivider(root, slice);
|
||||
|
|
|
@ -307,6 +307,20 @@ void Session::clear() {
|
|||
// Optimization: clear notifications before destroying items.
|
||||
Core::App().notifications().clearFromSession(_session);
|
||||
|
||||
// We must clear all forums before clearing customEmojiManager.
|
||||
// Because in Data::ForumTopic an Ui::Text::CustomEmoji is cached.
|
||||
auto forums = base::flat_set<not_null<ChannelData*>>();
|
||||
for (const auto &[peerId, peer] : _peers) {
|
||||
if (const auto channel = peer->asChannel()) {
|
||||
if (channel->isForum()) {
|
||||
forums.emplace(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const auto &channel : forums) {
|
||||
channel->setFlags(channel->flags() & ~ChannelDataFlag::Forum);
|
||||
}
|
||||
|
||||
_sendActionManager->clear();
|
||||
|
||||
_histories->unloadAll();
|
||||
|
@ -1244,21 +1258,7 @@ void Session::setupUserIsContactViewer() {
|
|||
}, _lifetime);
|
||||
}
|
||||
|
||||
Session::~Session() {
|
||||
// We must clear all forums before clearing customEmojiManager.
|
||||
// Because in Data::ForumTopic an Ui::Text::CustomEmoji is cached.
|
||||
auto forums = base::flat_set<not_null<ChannelData*>>();
|
||||
for (const auto &[peerId, peer] : _peers) {
|
||||
if (const auto channel = peer->asChannel()) {
|
||||
if (channel->isForum()) {
|
||||
forums.emplace(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const auto &channel : forums) {
|
||||
channel->setFlags(channel->flags() & ~ChannelDataFlag::Forum);
|
||||
}
|
||||
}
|
||||
Session::~Session() = default;
|
||||
|
||||
template <typename Method>
|
||||
void Session::enumerateItemViews(
|
||||
|
|
|
@ -12,9 +12,23 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_session.h"
|
||||
#include "storage/serialize_common.h"
|
||||
#include "ui/chat/chat_theme.h"
|
||||
#include "ui/color_int_conversion.h"
|
||||
#include "core/application.h"
|
||||
#include "main/main_session.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
QColor ColorFromSerialized(MTPint serialized) {
|
||||
return ColorFromSerialized(serialized.v);
|
||||
}
|
||||
|
||||
std::optional<QColor> MaybeColorFromSerialized(
|
||||
const tl::conditional<MTPint> &mtp) {
|
||||
return mtp ? ColorFromSerialized(*mtp) : std::optional<QColor>();
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
||||
namespace Data {
|
||||
namespace {
|
||||
|
||||
|
@ -38,6 +52,8 @@ constexpr auto kIncorrectDefaultBackground = FromLegacyBackgroundId(105);
|
|||
constexpr auto kVersionTag = qint32(0x7FFFFFFF);
|
||||
constexpr auto kVersion = 1;
|
||||
|
||||
using Ui::MaybeColorFromSerialized;
|
||||
|
||||
[[nodiscard]] quint32 SerializeColor(const QColor &color) {
|
||||
return (quint32(std::clamp(color.red(), 0, 255)) << 16)
|
||||
| (quint32(std::clamp(color.green(), 0, 255)) << 8)
|
||||
|
@ -57,7 +73,8 @@ constexpr auto kVersion = 1;
|
|||
}
|
||||
result.reserve(4);
|
||||
result.push_back(*c1);
|
||||
const auto c2 = MaybeColorFromSerialized(data.vsecond_background_color());
|
||||
const auto c2 = MaybeColorFromSerialized(
|
||||
data.vsecond_background_color());
|
||||
if (!c2) {
|
||||
return result;
|
||||
}
|
||||
|
@ -67,7 +84,8 @@ constexpr auto kVersion = 1;
|
|||
return result;
|
||||
}
|
||||
result.push_back(*c3);
|
||||
const auto c4 = MaybeColorFromSerialized(data.vfourth_background_color());
|
||||
const auto c4 = MaybeColorFromSerialized(
|
||||
data.vfourth_background_color());
|
||||
if (!c4) {
|
||||
return result;
|
||||
}
|
||||
|
@ -712,29 +730,6 @@ QImage GenerateDitheredGradient(const Data::WallPaper &paper) {
|
|||
paper.gradientRotation());
|
||||
}
|
||||
|
||||
QColor ColorFromSerialized(quint32 serialized) {
|
||||
return QColor(
|
||||
int((serialized >> 16) & 0xFFU),
|
||||
int((serialized >> 8) & 0xFFU),
|
||||
int(serialized & 0xFFU));
|
||||
}
|
||||
|
||||
QColor ColorFromSerialized(MTPint serialized) {
|
||||
return ColorFromSerialized(serialized.v);
|
||||
}
|
||||
|
||||
std::optional<QColor> MaybeColorFromSerialized(
|
||||
quint32 serialized) {
|
||||
return (serialized == quint32(-1))
|
||||
? std::nullopt
|
||||
: std::make_optional(ColorFromSerialized(serialized));
|
||||
}
|
||||
|
||||
std::optional<QColor> MaybeColorFromSerialized(
|
||||
const tl::conditional<MTPint> &mtp) {
|
||||
return mtp ? std::make_optional(ColorFromSerialized(*mtp)) : std::nullopt;
|
||||
}
|
||||
|
||||
namespace details {
|
||||
|
||||
WallPaper UninitializedWallPaper() {
|
||||
|
|
|
@ -15,6 +15,14 @@ namespace Main {
|
|||
class Session;
|
||||
} // namespace Main
|
||||
|
||||
namespace Ui {
|
||||
|
||||
[[nodiscard]] QColor ColorFromSerialized(MTPint serialized);
|
||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||
const tl::conditional<MTPint> &mtp);
|
||||
|
||||
} // namespace Ui
|
||||
|
||||
namespace Data {
|
||||
|
||||
struct FileOrigin;
|
||||
|
@ -126,13 +134,6 @@ private:
|
|||
|
||||
[[nodiscard]] QImage GenerateDitheredGradient(const WallPaper &paper);
|
||||
|
||||
[[nodiscard]] QColor ColorFromSerialized(quint32 serialized);
|
||||
[[nodiscard]] QColor ColorFromSerialized(MTPint serialized);
|
||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||
quint32 serialized);
|
||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||
const tl::conditional<MTPint> &mtp);
|
||||
|
||||
namespace details {
|
||||
|
||||
[[nodiscard]] WallPaper UninitializedWallPaper();
|
||||
|
|
|
@ -19,6 +19,23 @@ DialogRow {
|
|||
textTop: pixels;
|
||||
}
|
||||
|
||||
ForumTopicIcon {
|
||||
size: pixels;
|
||||
font: font;
|
||||
textTop: pixels;
|
||||
}
|
||||
|
||||
defaultForumTopicIcon: ForumTopicIcon {
|
||||
size: 21px;
|
||||
font: font(bold 12px);
|
||||
textTop: 3px;
|
||||
}
|
||||
largeForumTopicIcon: ForumTopicIcon {
|
||||
size: 26px;
|
||||
font: font(bold 13px);
|
||||
textTop: 4px;
|
||||
}
|
||||
|
||||
dialogsUnreadFont: font(12px bold);
|
||||
dialogsUnreadHeight: 19px;
|
||||
dialogsUnreadPadding: 5px;
|
||||
|
|
|
@ -1156,13 +1156,14 @@ ServiceAction ParseServiceAction(
|
|||
auto content = ActionTopicCreate();
|
||||
content.title = ParseString(data.vtitle());
|
||||
result.content = content;
|
||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
||||
auto content = ActionTopicEditTitle();
|
||||
content.title = ParseString(data.vtitle());
|
||||
result.content = content;
|
||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
||||
auto content = ActionTopicEditIcon();
|
||||
content.emojiDocumentId = data.vemoji_document_id().v;
|
||||
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||
auto content = ActionTopicEdit();
|
||||
if (const auto title = data.vtitle()) {
|
||||
content.title = ParseString(*title);
|
||||
}
|
||||
if (const auto icon = data.vicon_emoji_id()) {
|
||||
content.iconEmojiId = icon->v;
|
||||
}
|
||||
result.content = content;
|
||||
}, [](const MTPDmessageActionEmpty &data) {});
|
||||
return result;
|
||||
|
|
|
@ -503,12 +503,9 @@ struct ActionTopicCreate {
|
|||
Utf8String title;
|
||||
};
|
||||
|
||||
struct ActionTopicEditTitle {
|
||||
struct ActionTopicEdit {
|
||||
Utf8String title;
|
||||
};
|
||||
|
||||
struct ActionTopicEditIcon {
|
||||
uint64 emojiDocumentId = 0;
|
||||
std::optional<uint64> iconEmojiId = 0;
|
||||
};
|
||||
|
||||
struct ServiceAction {
|
||||
|
@ -545,8 +542,7 @@ struct ServiceAction {
|
|||
ActionWebViewDataSent,
|
||||
ActionGiftPremium,
|
||||
ActionTopicCreate,
|
||||
ActionTopicEditTitle,
|
||||
ActionTopicEditIcon> content;
|
||||
ActionTopicEdit> content;
|
||||
};
|
||||
|
||||
ServiceAction ParseServiceAction(
|
||||
|
|
|
@ -1150,16 +1150,19 @@ auto HtmlWriter::Wrap::pushMessage(
|
|||
+ " created topic «"
|
||||
+ SerializeString(data.title)
|
||||
+ "»";
|
||||
}, [&](const ActionTopicEditTitle &data) {
|
||||
return serviceFrom
|
||||
+ " changed topic title to «"
|
||||
+ SerializeString(data.title)
|
||||
+ "»";
|
||||
}, [&](const ActionTopicEditIcon &data) {
|
||||
return serviceFrom
|
||||
+ " changed topic icon to «"
|
||||
+ QString::number(data.emojiDocumentId).toUtf8()
|
||||
+ "»";
|
||||
}, [&](const ActionTopicEdit &data) {
|
||||
auto parts = QList<QByteArray>();
|
||||
if (!data.title.isEmpty()) {
|
||||
parts.push_back("title to «"
|
||||
+ SerializeString(data.title)
|
||||
+ "»");
|
||||
}
|
||||
if (data.iconEmojiId) {
|
||||
parts.push_back("icon to «"
|
||||
+ QString::number(*data.iconEmojiId).toUtf8()
|
||||
+ "»");
|
||||
}
|
||||
return serviceFrom + " changed topic " + parts.join(',');
|
||||
}, [](v::null_t) { return QByteArray(); });
|
||||
|
||||
if (!serviceText.isEmpty()) {
|
||||
|
|
|
@ -564,14 +564,15 @@ QByteArray SerializeMessage(
|
|||
pushActor();
|
||||
pushAction("topic_created");
|
||||
push("title", data.title);
|
||||
}, [&](const ActionTopicEditTitle &data) {
|
||||
}, [&](const ActionTopicEdit &data) {
|
||||
pushActor();
|
||||
pushAction("topic_title_edit");
|
||||
push("title", data.title);
|
||||
}, [&](const ActionTopicEditIcon &data) {
|
||||
pushActor();
|
||||
pushAction("topic_icon_edit");
|
||||
push("emoji_document_id", data.emojiDocumentId);
|
||||
pushAction("topic_edit");
|
||||
if (!data.title.isEmpty()) {
|
||||
push("new_title", data.title);
|
||||
}
|
||||
if (data.iconEmojiId) {
|
||||
push("new_icon_emoji_id", *data.iconEmojiId);
|
||||
}
|
||||
}, [](v::null_t) {});
|
||||
|
||||
if (v::is_null(message.action.content)) {
|
||||
|
|
|
@ -1080,18 +1080,18 @@ void History::applyServiceChanges(
|
|||
forum->applyTopicAdded(
|
||||
item->id,
|
||||
qs(data.vtitle()),
|
||||
data.vicon_color().v,
|
||||
data.vicon_emoji_id().value_or(DocumentId()));
|
||||
}
|
||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
||||
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||
if (const auto forum = peer->forum()) {
|
||||
if (const auto topic = forum->topicFor(item)) {
|
||||
topic->applyTitle(qs(data.vtitle()));
|
||||
}
|
||||
}
|
||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
||||
if (const auto forum = peer->forum()) {
|
||||
if (const auto topic = forum->topicFor(item)) {
|
||||
topic->applyIconId(data.vemoji_document_id().v);
|
||||
if (const auto &title = data.vtitle()) {
|
||||
topic->applyTitle(qs(*title));
|
||||
}
|
||||
if (const auto icon = data.vicon_emoji_id()) {
|
||||
topic->applyIconId(icon->v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [](const auto &) {
|
||||
|
|
|
@ -643,26 +643,24 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
|||
return result;
|
||||
};
|
||||
|
||||
auto prepareTopicEditTitle = [&](const MTPDmessageActionTopicEditTitle &action) {
|
||||
auto prepareTopicEdit = [&](const MTPDmessageActionTopicEdit &action) {
|
||||
auto result = PreparedText{};
|
||||
// #TODO forum lang
|
||||
result.text = { "topic edited: " + qs(action.vtitle()) };
|
||||
return result;
|
||||
};
|
||||
|
||||
auto prepareTopicEditIcon = [&](const MTPDmessageActionTopicEditIcon &action) {
|
||||
auto result = PreparedText{};
|
||||
result.text = { "topic icon: " }; // #TODO forum lang
|
||||
result.text.append(TextWithEntities{
|
||||
"@",
|
||||
{ EntityInText(
|
||||
EntityType::CustomEmoji,
|
||||
0,
|
||||
1,
|
||||
Data::SerializeCustomEmojiId({
|
||||
.id = action.vemoji_document_id().v })) },
|
||||
});
|
||||
|
||||
result.text = { "topic edited: " }; // #TODO forum lang
|
||||
if (const auto icon = action.vicon_emoji_id()) {
|
||||
result.text.append(TextWithEntities{
|
||||
"@",
|
||||
{ EntityInText(
|
||||
EntityType::CustomEmoji,
|
||||
0,
|
||||
1,
|
||||
Data::SerializeCustomEmojiId({ .id = icon->v }))
|
||||
},
|
||||
});
|
||||
}
|
||||
if (const auto &title = action.vtitle()) {
|
||||
result.text.append(qs(*title));
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
@ -737,10 +735,8 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) {
|
|||
return prepareGiftPremium(data);
|
||||
}, [&](const MTPDmessageActionTopicCreate &data) {
|
||||
return prepareTopicCreate(data);
|
||||
}, [&](const MTPDmessageActionTopicEditTitle &data) {
|
||||
return prepareTopicEditTitle(data);
|
||||
}, [&](const MTPDmessageActionTopicEditIcon &data) {
|
||||
return prepareTopicEditIcon(data);
|
||||
}, [&](const MTPDmessageActionTopicEdit &data) {
|
||||
return prepareTopicEdit(data);
|
||||
}, [&](const MTPDmessageActionWebViewDataSentMe &data) {
|
||||
LOG(("API Error: messageActionWebViewDataSentMe received."));
|
||||
return PreparedText{
|
||||
|
@ -1312,8 +1308,10 @@ MsgId HistoryService::replyToTop() const {
|
|||
|
||||
MsgId HistoryService::topicRootId() const {
|
||||
if (const auto data = GetDependentData()
|
||||
; data && data->topicPost) {
|
||||
; data && data->topicPost && data->topId) {
|
||||
return data->topId;
|
||||
} else if (const auto topic = Get<HistoryServiceTopicInfo>()) {
|
||||
return id;
|
||||
}
|
||||
return Data::ForumTopic::kGeneralId;
|
||||
}
|
||||
|
@ -1455,9 +1453,9 @@ void HistoryService::createFromMtp(const MTPDmessageService &message) {
|
|||
if (type == mtpc_messageActionPinMessage) {
|
||||
UpdateComponents(HistoryServicePinned::Bit());
|
||||
} else if (type == mtpc_messageActionTopicCreate
|
||||
|| type == mtpc_messageActionTopicEditTitle
|
||||
|| type == mtpc_messageActionTopicEditIcon) {
|
||||
|| type == mtpc_messageActionTopicEdit) {
|
||||
UpdateComponents(HistoryServiceTopicInfo::Bit());
|
||||
Get<HistoryServiceTopicInfo>()->topicPost = true;
|
||||
} else if (type == mtpc_messageActionSetChatTheme) {
|
||||
setupChatThemeChange();
|
||||
} else if (type == mtpc_messageActionSetMessagesTTL) {
|
||||
|
@ -1548,6 +1546,8 @@ void HistoryService::createFromMtp(const MTPDmessageService &message) {
|
|||
dependent->msgId = data.vreply_to_msg_id().v;
|
||||
dependent->topId = data.vreply_to_top_id().value_or(
|
||||
data.vreply_to_msg_id().v);
|
||||
dependent->topicPost = data.is_forum_topic()
|
||||
|| Has<HistoryServiceTopicInfo>();
|
||||
if (!updateDependent()) {
|
||||
RequestDependentMessageData(
|
||||
this,
|
||||
|
|
|
@ -756,10 +756,12 @@ bool Element::computeIsAttachToPrevious(not_null<Element*> previous) {
|
|||
const auto item = data();
|
||||
if (!Has<DateBadge>() && !Has<UnreadBar>()) {
|
||||
const auto prev = previous->data();
|
||||
const auto previousMarkup = prev->inlineReplyMarkup();
|
||||
const auto possible = (std::abs(prev->date() - item->date())
|
||||
< kAttachMessageToPreviousSecondsDelta)
|
||||
&& mayBeAttached(this)
|
||||
&& mayBeAttached(previous);
|
||||
&& mayBeAttached(previous)
|
||||
&& (!previousMarkup || previousMarkup->hiddenBy(prev->media()));
|
||||
if (possible) {
|
||||
const auto forwarded = item->Get<HistoryMessageForwarded>();
|
||||
const auto prevForwarded = prev->Get<HistoryMessageForwarded>();
|
||||
|
|
25
Telegram/SourceFiles/ui/color_int_conversion.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "ui/color_int_conversion.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
QColor ColorFromSerialized(quint32 serialized) {
|
||||
return QColor(
|
||||
int((serialized >> 16) & 0xFFU),
|
||||
int((serialized >> 8) & 0xFFU),
|
||||
int(serialized & 0xFFU));
|
||||
}
|
||||
|
||||
std::optional<QColor> MaybeColorFromSerialized(quint32 serialized) {
|
||||
return (serialized == quint32(-1))
|
||||
? std::nullopt
|
||||
: std::make_optional(ColorFromSerialized(serialized));
|
||||
}
|
||||
|
||||
} // namespace Ui
|
16
Telegram/SourceFiles/ui/color_int_conversion.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
namespace Ui {
|
||||
|
||||
[[nodiscard]] QColor ColorFromSerialized(quint32 serialized);
|
||||
[[nodiscard]] std::optional<QColor> MaybeColorFromSerialized(
|
||||
quint32 serialized);
|
||||
|
||||
} // namespace Ui
|
|
@ -266,6 +266,8 @@ PRIVATE
|
|||
ui/cached_round_corners.h
|
||||
ui/color_contrast.cpp
|
||||
ui/color_contrast.h
|
||||
ui/color_int_conversion.cpp
|
||||
ui/color_int_conversion.h
|
||||
ui/grouped_layout.cpp
|
||||
ui/grouped_layout.h
|
||||
ui/widgets/fields/special_fields.cpp
|
||||
|
|