1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-30 02:53:11 +02:00

Make TweetNotification use persistent column ID

This commit is contained in:
2017-08-28 22:38:11 +02:00
parent cd87a329fc
commit d7ad62d476
4 changed files with 10 additions and 10 deletions

@@ -543,7 +543,7 @@ namespace TweetDuck.Core{
return false;
}
public void ShowTweetDetail(string columnKey, string chirpId, string fallbackUrl){
public void ShowTweetDetail(string columnId, string chirpId, string fallbackUrl){
Activate();
using(IFrame frame = browser.GetBrowser().MainFrame){
@@ -554,7 +554,7 @@ namespace TweetDuck.Core{
}
notification.FinishCurrentNotification();
browser.ExecuteScriptAsync("window.TDGF_showTweetDetail", columnKey, chirpId, fallbackUrl);
browser.ExecuteScriptAsync("window.TDGF_showTweetDetail", columnId, chirpId, fallbackUrl);
}
public void OnTweetScreenshotReady(string html, int width, int height){

@@ -197,7 +197,7 @@ namespace TweetDuck.Core.Notification{
}
public void ShowTweetDetail(){
owner.ShowTweetDetail(currentNotification.ColumnKey, currentNotification.ChirpId, currentNotification.TweetUrl);
owner.ShowTweetDetail(currentNotification.ColumnId, currentNotification.ChirpId, currentNotification.TweetUrl);
}
public void MoveToVisibleLocation(){

@@ -55,7 +55,7 @@ namespace TweetDuck.Core.Notification{
Auto, Custom
}
public string ColumnKey { get; }
public string ColumnId { get; }
public string ChirpId { get; }
public string ColumnTitle { get; }
@@ -66,10 +66,10 @@ namespace TweetDuck.Core.Notification{
private readonly int characters;
private readonly bool isExample;
public TweetNotification(string columnKey, string chirpId, string title, string html, int characters, string tweetUrl, string quoteUrl) : this(columnKey, chirpId, title, html, characters, tweetUrl, quoteUrl, false){}
public TweetNotification(string columnId, string chirpId, string title, string html, int characters, string tweetUrl, string quoteUrl) : this(columnId, chirpId, title, html, characters, tweetUrl, quoteUrl, false){}
private TweetNotification(string columnKey, string chirpId, string title, string html, int characters, string tweetUrl, string quoteUrl, bool isExample){
this.ColumnKey = columnKey;
private TweetNotification(string columnId, string chirpId, string title, string html, int characters, string tweetUrl, string quoteUrl, bool isExample){
this.ColumnId = columnId;
this.ChirpId = chirpId;
this.ColumnTitle = title;

@@ -201,7 +201,7 @@
let tweetUrl = source ? source.getChirpURL() : "";
let quoteUrl = source && source.quotedTweet ? source.quotedTweet.getChirpURL() : "";
$TD.onTweetPopup(column.model.privateState.key, chirpId, columnTypes[column.getColumnType()] || "", html.html(), duration, tweetUrl, quoteUrl);
$TD.onTweetPopup(column.model.privateState.apiid, chirpId, columnTypes[column.getColumnType()] || "", html.html(), duration, tweetUrl, quoteUrl);
}
if (column.model.getHasSound()){
@@ -221,8 +221,8 @@
$(document).trigger("uiGridClearSelection");
};
window.TDGF_showTweetDetail = function(columnKey, chirpId, fallbackUrl){
let column = TD.controller.columnManager.get(columnKey); // TODO replace columnKey with something that stays after a reload
window.TDGF_showTweetDetail = function(columnId, chirpId, fallbackUrl){
let column = TD.controller.columnManager.getByApiid(columnId);
if (!column){
if (confirm("error|The column which contained the tweet no longer exists. Would you like to open the tweet in your browser instead?")){