Created
April 22, 2014 11:49
-
-
Save kb10uy/11175698 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//改良前のコード抜粋 | |
if (artifact["target_object"] != null) | |
{ | |
return DeserializeUserStreamEvent(content); | |
} | |
/* | |
・問題点 | |
1.イベントの条件が「target_objectがあるかどうか」 | |
2.そのせいでtarget_objectがないfollowとかuser_updateは | |
切り捨てられる | |
*/ | |
//改良後 | |
//条件をeventがあるかどうかにして | |
//更にtarget_objectがあるかどうかで分岐 | |
if (artifact["event"] != null) | |
{ | |
if (artifact["target_object"] != null) | |
{ | |
return DeserializeUserStreamEvent(content); | |
} | |
else | |
{ | |
//自作メソッド | |
//target_objectを変換しない以外は上に同じ | |
return DeserializeUserStreamUserEvent(content); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment