1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-13 18:15:48 +02:00

Make TweetNotification use persistent column ID

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

View File

@ -543,7 +543,7 @@ public bool ProcessBrowserKey(Keys key){
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 @@ public void ShowTweetDetail(string columnKey, string chirpId, string fallbackUrl
}
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){

View File

@ -197,7 +197,7 @@ protected virtual void UpdateTitle(){
}
public void ShowTweetDetail(){
owner.ShowTweetDetail(currentNotification.ColumnKey, currentNotification.ChirpId, currentNotification.TweetUrl);
owner.ShowTweetDetail(currentNotification.ColumnId, currentNotification.ChirpId, currentNotification.TweetUrl);
}
public void MoveToVisibleLocation(){

View File

@ -55,7 +55,7 @@ public enum Size{
Auto, Custom
}
public string ColumnKey { get; }
public string ColumnId { get; }
public string ChirpId { get; }
public string ColumnTitle { get; }
@ -66,10 +66,10 @@ public enum Size{
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;

View File

@ -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?")){