如何获得邮件线索的网址了解线程ID? [英] How to get message thread URL knowing the thread id?

查看:143
本文介绍了如何获得邮件线索的网址了解线程ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有<一个href=\"http://facebook.stackoverflow.com/questions/7747622/how-can-i-construct-a-link-to-view-a-message-on-facebook-com-if-i-have-the-messa\">How我可以构建一个链接以查看facebook.com一条消息,如果我有消息ID 的问题,但它是无人接听。如果我使用了/我/收件箱API端点,需要用户重定向到Facebook的本身显示该线程的线程的ID?我如何构造URL。似乎有像<一个网址href=\"http://www.facebook.com/messages/?action=read&tid=id.143666952390138\">http://www.facebook.com/messages/?action=read&tid=id.143666952390138其中,线程ID是到底有多少。但也有一些陌生网址,像<一个href=\"http://www.facebook.com/messages/?action=read&tid=27726d81656e4c07ae5654116cccb724\">http://www.facebook.com/messages/?action=read&tid=27726d81656e4c07ae5654116cccb724其中previous规则不起作用。
是否有任何解决方案,以使用图形API或FQL?

There is How can I construct a link to view a message on facebook.com if I have the message id question, but it is unanswered. What if I got the id of the thread using /me/inbox API endpoint and need to redirect user to the Facebook itself showing this thread? How do I construct the URL. There seem to be URLs like http://www.facebook.com/messages/?action=read&tid=id.143666952390138 where thread id is the number in the end. But there are also some stranger URLs like http://www.facebook.com/messages/?action=read&tid=27726d81656e4c07ae5654116cccb724 where the previous rule doesn't work. Is there any solution to getting thread URL using Graph API or FQL?

推荐答案

如果你有id是一个字符串对象(可能是一个GUID),​​这是来自Facebook的较旧的消息系统的存储结构。现在,他们已经更新到需要旧的要迁移到新的一个新的存储结构

If the id you have is a string object (probably a guid), this is from Facebook's older message system storage structure. Now they've updated to a new storage structure that requires the old ones to be migrated into the new

所以,你有一个相当简单的检查:

So you have a fairly easy check:

如果线程ID是一个长期(的Int64 / BigInt有),那么你有一个新的线程,并且可以使用
http://www.facebook.com/messages/?action=read&tid=id.THREAD_ID

If thread id is a long (Int64/BigInt), then you have a new thread and can use http://www.facebook.com/messages/?action=read&tid=id.THREAD_ID

如果线程ID是一个字符串,那么你有一个旧的线程,并可以使用

If thread id is a string then you have a older thread and can use

http://www.facebook.com/messages/?action=read&tid=THREAD_ID

许多编程语言都有自己的检查值的类型的形式。

many programming languages have their own form of checking the type of a value.

var threadId = (string)data.thread_id;
var longVal = 0L;    
var isLong = Int64.TryParse(threadId, out longVal);
var threadUrl = (isLong) ? 
  "http://www.facebook.com/messages/?action=read&tid=id." + threadId :
  "http://www.facebook.com/messages/?action=read&tid=" + threadId;

这篇关于如何获得邮件线索的网址了解线程ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆