| 491 | } |
| 492 | |
| 493 | ForumTopic *Forum::applyTopicAdded( |
| 494 | MsgId rootId, |
| 495 | const QString &title, |
| 496 | int32 colorId, |
| 497 | DocumentId iconId, |
| 498 | PeerId creatorId, |
| 499 | TimeId date, |
| 500 | bool my) { |
| 501 | Expects(rootId != 0); |
| 502 | |
| 503 | const auto i = _topics.find(rootId); |
| 504 | const auto raw = (i != end(_topics)) |
| 505 | ? i->second.get() |
| 506 | : _topics.emplace( |
| 507 | rootId, |
| 508 | std::make_unique<ForumTopic>(this, rootId) |
| 509 | ).first->second.get(); |
| 510 | raw->applyTitle(title); |
| 511 | raw->applyColorId(colorId); |
| 512 | raw->applyIconId(iconId); |
| 513 | raw->applyCreator(creatorId); |
| 514 | raw->applyCreationDate(date); |
| 515 | raw->applyIsMy(my); |
| 516 | if (!creating(rootId)) { |
| 517 | raw->addToChatList(FilterId(), topicsList()); |
| 518 | _chatsListChanges.fire({}); |
| 519 | reorderLastTopics(); |
| 520 | } |
| 521 | return raw; |
| 522 | } |
| 523 | |
| 524 | MsgId Forum::reserveCreatingId( |
| 525 | const QString &title, |
no test coverage detected